IOS开发—UITableViewCell的四种类型
来源:互联网 发布:淘宝上买cpu可靠吗 编辑:程序博客网 时间:2024/05/29 03:16
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell; switch (indexPath.row) { case 0: { cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CELL1]; cell.backgroundColor = [UIColor yellowColor]; cell.selectionStyle = UITableViewCellSelectionStyleDefault; } break; case 1: { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CELL2]; cell.backgroundColor = [UIColor redColor]; cell.selectionStyle = UITableViewCellSelectionStyleGray; } break; case 2: { cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CELL2]; cell.backgroundColor = [UIColor blueColor]; cell.selectionStyle = UITableViewCellSelectionStyleBlue; } break; case 3: { cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CELL4]; cell.backgroundColor = [UIColor purpleColor]; cell.selectionStyle = UITableViewCellSelectionStyleDefault; } break; } cell.imageView.image = [UIImage imageNamed:@"warning_btn"]; cell.detailTextLabel.text = @"detailTextLabel"; cell.textLabel.text = @"textLabel"; return cell;}
运行效果:
0 0
- IOS开发—UITableViewCell的四种类型
- ios开发者四种类型
- ios开发:UITableViewCell的操作
- ios开发:UITableViewCell的操作
- iOS开发UI篇—UITableviewcell的性能问题
- iOS开发UI篇—UITableviewcell的性能问题
- 如何为Apache JMeter开发插件(四)——几种类型的Sampler
- 四种类型的css
- NoSQL的四种类型
- 程序员的四种类型
- 程序员的四种类型
- 程序员的四种类型
- 程序员的四种类型
- 程序员的四种类型
- NAT 的四种类型
- NoSQL的四种类型
- 程序员的四种类型
- mutex的四种类型
- C语言 打印路径节点值的和为指定和的所有路径
- 2015年6月10日 星期三 下午
- 二叉排序树的C++实现
- CSS中几个与换行有关的属性简明总结_css3_CSS_网页制作
- MySQL 系统架构 说明
- IOS开发—UITableViewCell的四种类型
- java基础
- 结构体
- 在storyboard中的静态UITableView中拖入 UISearchBar and Search Display Controller出现的奇怪问题
- Android 下拉刷新框架实现
- SAT数学题常用符号介绍
- hive中求top k的两种方式
- GRE写作:十字坐标定位法
- add ssh-key to github