【发布时间】:2013-06-21 20:24:42
【问题描述】:
我在 Monotouch.Dialog UITableView 中有一系列 StyledStringElements。
我希望每隔一行设置不同的背景颜色(财务报告)。
是否有现有的方法可以做到这一点,如果没有,我可以覆盖什么来启用它?
在标准 UITableView 中,我会为表创建一个新委托,如下所示:
public class AlternatingTableViewDelegate : UITableViewDelegate
{
public override void WillDisplay(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
if (indexPath.Row%2 == 0)
{
cell.BackgroundColor = UIColor.White;
}
else
{
cell.BackgroundColor = Settings.ColorAlternatingRow;
}
}
}
【问题讨论】:
标签: iphone uitableview xamarin.ios xamarin monotouch.dialog