Monotouch.Dialog UITableView に一連の StyledStringElements があります。
1 行おきに異なる背景色 (財務レポート) を設定したいと考えています。
これを行う既存の方法はありますか?そうでない場合、これを有効にするために何をオーバーライドできますか?
標準の 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;
}
}
}