Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better UI consistency when using transparency effects. #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MonoTouch.Dialog/Elements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -762,14 +762,20 @@ void PrepareCell (UITableViewCell cell)
imgView.Image = img;

if (cell.DetailTextLabel != null)
{
cell.DetailTextLabel.TextColor = extraInfo.DetailColor ?? UIColor.Black;
cell.DetailTextLabel.BackgroundColor = UIColor.Clear;
}
}
}

void ClearBackground (UITableViewCell cell)
{
cell.BackgroundColor = UIColor.White;
cell.TextLabel.BackgroundColor = UIColor.Clear;

if (cell.DetailTextLabel != null)
cell.DetailTextLabel.BackgroundColor = UIColor.Clear;
}

void IColorizeBackground.WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
Expand Down
11 changes: 10 additions & 1 deletion MonoTouch.Dialog/Elements/OwnerDrawnElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override UITableViewCell GetCell (UITableView tv)

cell.Update();
return cell;
}
}

public abstract void Draw(RectangleF bounds, CGContext context, UIView view);

Expand All @@ -58,6 +58,14 @@ class OwnerDrawnCell : UITableViewCell
public OwnerDrawnCell(OwnerDrawnElement element, UITableViewCellStyle style, string cellReuseIdentifier) : base(style, cellReuseIdentifier)
{
Element = element;

// This trick is necessary to keep the background clear, otherwise
// it gets painted as black
//
BackgroundView = new UIView (RectangleF.Empty) {
BackgroundColor = UIColor.Clear
};
SelectionStyle = UITableViewCellSelectionStyle.None;
}

public OwnerDrawnElement Element
Expand Down Expand Up @@ -101,6 +109,7 @@ class OwnerDrawnCellView : UIView
public OwnerDrawnCellView(OwnerDrawnElement element)
{
this.element = element;
BackgroundColor = UIColor.Clear;
}


Expand Down