UITableView 相关属性的设置
来源:互联网 发布:我的世界ip地址和端口 编辑:程序博客网 时间:2024/05/01 20:42
1.获取tableview中的cell
/*1.定义cell高度时,获取cell的方法*///ContentTVCell 自己自定义的cell//jokeTableview UITableView 对象ContentTVCell *cell=(ContentTVCell*)[self tableView:self.jokeTableView cellForRowAtIndexPath:indexPath];/*2.获取选中的cell*///获取选中的cell的indexPath NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];/*3.刷新某一个section*///刷新tableview的某一个sectionNSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:1];[self.baseTableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
2. cell的选中状态
//取消cell的选中状态 self.selectionStyle = UITableViewCellSelectionStyleNone;/*自定义UITableViewCell选中后的背景颜色和背景图片*/UIColor* color=[[UIColor alloc]initWithRed:0.0 green:0.0 blue:0.0 alpha:1];//通过RGB来定义颜色 cell.selectedBackgroundView=[[UIView alloc]initWithFrame:cell.frame]autorelease];cell.selectedBackgroundView.backgroundColor=[UIColor ***]或color;//自定义选中后的背景图片cell.selectedBackgroundView=[[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"123.png"]]autorelease];//设置UITableViewCell中的字体颜色时用cell.textLabel.highlightedTextColor=[UIColor **color];
3.隐藏UITableViewCell的分隔线
[chatTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];/* // UITableViewCellSeparatorStyle有如下几种 typedef enum { UITableViewCellSeparatorStyleNone, UITableViewCellSeparatorStyleSingleLine, UITableViewCellSeparatorStyleSingleLineEtched} UITableViewCellSeparatorStyle;*/
4.定义UITableViewCell的样式
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;/*accessoryType有如下几种typedef enum { UITableViewCellAccessoryNone, UITableViewCellAccessoryDisclosureIndicator, UITableViewCellAccessoryDetailDisclosureButton, UITableViewCellAccessoryCheckmark} UITableViewCellAccessoryType;*/
1 0
- UITableView 相关属性的设置
- UITableView的相关属性
- UITableView 表视图 代码设置相关属性
- UITableView 右侧索引栏 的相关设置
- UILabel的相关属性设置
- UILabel的相关属性设置
- UILabel的相关属性设置
- UILabel的相关属性设置
- ListView的相关属性设置
- UILabel的相关属性设置
- UILabel的相关属性设置
- UIScrollView && UITableView相关属性汇总
- UIScrollView && UITableView相关属性汇总
- UITableView 相关属性和方法
- UITableView的常用属性
- UITableView的一些属性
- UITableView 的属性
- UITableView的一些属性
- 编程过程中遇到的符号的英文名称
- lintCode(372)——在O(1)时间复杂度删除链表节点
- ASP.net Membership角色与权限管理(二)
- MySQL双主环境搭建
- zookeeper、zkui、kafka部署技术
- UITableView 相关属性的设置
- 中断处理的 tasklet 机制
- Jsoup +JavaScript 扒取网站模板 bootstarp
- PLSQL Developer连接远程oracle配置
- 四、Android App Manifest(清单)--Android Api 中文翻译(一)
- 初学memcached
- [从头学数学] 第166节 [机器小伟]的结丹期修炼规划
- pat--一元多项式的乘法与加法
- sdut 2413 字符加密