博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
设置tableViewCell背景颜色
阅读量:7119 次
发布时间:2019-06-28

本文共 567 字,大约阅读时间需要 1 分钟。

1
2
3
4
5
6
7
8
9
10
11
12
13
//方法一:
cell
.contentView
.backgroundColor
= [
UIColor
redColor
];
//方法二:
UITableViewCell
*cell = [tableView
dequeueReusableCellWithIdentifier
:CellIdentifier];
UIView* bgview = [[
UIView
alloc
]
initWithFrame
:CGRectMake(
0
,
0
,
1
,
1
)];
bgview
.opaque
=
YES
;
bgview
.backgroundColor
= [
UIColor
orangeColor
];
[cell
setBackgroundView
:bgview];
//方法三:
- (
void
)tableView:(
UITableView
*)tableView
willDisplayCell
:(
UITableViewCell
*)cell
forRowAtIndexPath
:(
NSIndexPath
*)indexPath
{
cell
.backgroundColor
= [
UIColor
redColor
];
}

转载地址:http://vlnel.baihongyu.com/

你可能感兴趣的文章
JOptionPane
查看>>
map按照value排序的方法
查看>>
[MAC OS] 解压Assets.car获取资源图片
查看>>
操作系统IO模型
查看>>
mvc4 中的 AuthorizeAttribute
查看>>
oracle 建实例异常:进度停留在2%、内存占用不断增大。环境:winserver2008 r2、8核16线程...
查看>>
C++ 的对象模型
查看>>
[下载地址] Maven - 插件(附详细配置_阿里版)
查看>>
web.xml配置详解之listener与context-param
查看>>
Spring的bean管理--注解和配置文件混合使用
查看>>
-save-dev 与 -save的区别
查看>>
TypeError: $(…).tooltip is not a function
查看>>
php count()函数用法 及其 一个坑
查看>>
Qt可扩展窗口实现
查看>>
JS自学笔记04
查看>>
MySQL基础
查看>>
写操作系统学到
查看>>
真正统治世界的十大算法
查看>>
FZU-2236 第十四个目标(树状数组)
查看>>
hibernate多表关联(<hibernate-mapping>)的配置
查看>>