0
我在Monotouch.Dialog UITableView中有一系列StyledStringElements。StyledStringElement UITableView中的交替背景
我希望每隔一行設置一個不同的背景顏色(財務報告)。
是否有現有的方法來做到這一點,如果不是,我可以重寫什麼來啓用它?
在一個標準的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;
}
}
}