【问题标题】:How to customize the background color of a UITableViewCell in xamarin ios?如何在 xamarin ios 中自定义 UITableViewCell 的背景颜色?
【发布时间】:2017-07-06 23:05:11
【问题描述】:

我想自定义 UITableView 中所有 UITableViewCells 的背景。到目前为止,我还无法自定义它们。

看这里:TableView

【问题讨论】:

    标签: ios xamarin.ios


    【解决方案1】:

    在您的 GetCell 方法中,只需执行以下操作:

            public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
                {
                  //Do cell stuff here
                MyTestCell myCell = tableView.DequeueReusableCell("MyTestCell") as MyTestCell;
                  .......
                  .........
                  myCell.BackgroundColor = UIColor.Blue;
                }
    

    这样,您所有的 UITableView 单元格都将具有您设置的颜色!

    【讨论】:

      猜你喜欢
      • 2010-09-21
      • 2019-10-28
      • 1970-01-01
      • 2018-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-15
      • 2012-06-05
      相关资源
      最近更新 更多