【发布时间】:2017-07-06 23:05:11
【问题描述】:
我想自定义 UITableView 中所有 UITableViewCells 的背景。到目前为止,我还无法自定义它们。
看这里:TableView
【问题讨论】:
标签: ios xamarin.ios
我想自定义 UITableView 中所有 UITableViewCells 的背景。到目前为止,我还无法自定义它们。
看这里:TableView
【问题讨论】:
标签: ios xamarin.ios
在您的 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 单元格都将具有您设置的颜色!
【讨论】: