ios - 如何在 xamarin ios 中自定义 UITableViewCell 的背景颜色?

标签 ios xamarin.ios

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

看看这里:TableView

最佳答案

在 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 单元格都将具有您设置的颜色!

关于ios - 如何在 xamarin ios 中自定义 UITableViewCell 的背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42297628/

相关文章:

c# - MKMapView - 可拖动引脚导致放置错误?

c# - 是否可以在应用程序级别连接到硬件键盘事件?

c# - 如何从选项卡式 View Controller 中使用导航 Controller ?

ios - 如何在swift中通过NSManagedObjectContext更新核心日期中的对象?

ios - 我怎样才能更新我的字典 ios Swift 中的数量值

ios - Xamarin 应用程序在一天未打开后启动时崩溃

xamarin.ios - 创建与桌面、wp7 和 monotouch 兼容的程序集

ios - 以编程方式按 UIkeyboard 返回键

ios - 如何在 UINavigationBar 中将信息从 child 发送到 parent (Unwind segue 问题)?

iphone - 如何在不重复的情况下水平对齐下划线?