博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UITableView 的使用小点
阅读量:4485 次
发布时间:2019-06-08

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

1.系统默认的颜色设置 //  cell.selectionStyle = UITableViewCellSelectionStyleNone;   //蓝色  cell.selectionStyle = UITableViewCellSelectionStyleBlue;   //灰色  cell.selectionStyle = UITableViewCellSelectionStyleGray;  2.自定义颜色和背景设置 改变UITableViewCell选中时背景色: UIColor *color = [[UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//通过来定义自己的颜色 cell.selectedBackgroundView = [[[UIView alloc] initWithFrame:cell.frame] autorelease];  cell.selectedBackgroundView.backgroundColor = [UIColor xxxxxx];  3.自定义UITableViewCell选中时背景 cell.selectedBackgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cellart.png"]] autorelease];  还有字体颜色  cell.textLabel.highlightedTextColor = [UIColor xxxcolor]; [cell.textLabel setTextColor:color] 4.设置tableViewCell间的分割线的颜色 [theTableView setSeparatorColor:[UIColor xxxx ]]; 5、设置cell中字体的颜色 Prettyprint代码 // Customize the appearance of table view cells.-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {   if(0== indexPath.row)   {     cell.textLabel.textColor =...;     cell.textLabel.highlightedTextColor =...;   }   ...}

转载于:https://www.cnblogs.com/qyfeng009/p/5470121.html

你可能感兴趣的文章
Pascal程序练习-与7无关的数
查看>>
多路复用IO模型
查看>>
利用Python爬虫刷店铺微博等访问量最简单有效教程
查看>>
[leetCode]Linked List Cycle I+II
查看>>
会了这十种Python优雅的写法,让你工作效率翻十倍,一人顶十人用!
查看>>
2013年终总结
查看>>
正则表达式
查看>>
Mysql的DATE_FORMAT()日期格式转换
查看>>
Windows Store App之数据存储
查看>>
English class 82 The Importance of traveling
查看>>
python用递归函数解汉诺塔游戏
查看>>
Redis与Python交互
查看>>
Maximum-SubsequenceSum
查看>>
Android无法删除项目+导入项目报错
查看>>
poj 2349(最小生成树应用)
查看>>
python接口自动化测试二十五:执行所有用例,并生成HTML测试报告
查看>>
c# 指定的存储区提供程序在配置中找不到,或者无效
查看>>
最简陋的python数据
查看>>
第一堂java web课
查看>>
操作系统简介
查看>>