ios tableView中在不同行中显示不同的颜色
2014-07-10 15:03
405 查看
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row %
2 == 1){
[cell setBackgroundColor:[UIColor yellowColor]];
}
else{//indexPath.row % 2 == 0
[cell setBackgroundColor:[UIColor lightGrayColor]];
}
[cell setSelectedBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_bg.png"]]];
}
if(indexPath.row %
2 == 1){
[cell setBackgroundColor:[UIColor yellowColor]];
}
else{//indexPath.row % 2 == 0
[cell setBackgroundColor:[UIColor lightGrayColor]];
}
[cell setSelectedBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_bg.png"]]];
}
相关文章推荐
- iOS tableview 选中一行后,不显示选中颜色
- 转战IOS之: tableview 选中一行后,不显示选中颜色的方法
- iOS 设置一行颜色不同的NSString 、剪切图片、设置TableView的自定义header
- iOS 不同按钮点击显示不同的tableview数据
- textView字体颜色根据不同状态显示不同颜色
- freemarker实现杂色显示(不同行颜色不同)
- 鼠标覆盖行高亮显示 奇偶行背景颜色不同 css+jquery Table
- iOS开发 自定义tableView样式(使用代码/使用Interface Builder)、分组显示、给TableView增加索引、给TableView增加SearchBar
- iOS 在UILabel显示不同的字体和颜色
- DevTreeList 不同行根据特定值显示不同颜色
- [转] iOS 在UILabel显示不同的字体和颜色
- ios:改变tableview的titleForHeaderInSection字体颜色设置
- TextView中显示不同颜色的文字和图片
- iOS开发笔记--UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- Android TextView 显示不同颜色的字
- textview中显示不同颜色的字体与显示图片
- TextView高级显示——显示不同颜色的字&水平滚动
- IOS查询结果以tableview显示的异常处理
- IOS UITableView 选中一行后,不显示选中颜色的方法