ios UITableView背景图片设置
2024-10-18 23:28:22
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:nil]; // 设置cell右边指示器的类型
if (indexPath.row % == ) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.accessoryView = [[UISwitch alloc] init]; // 设置背景(背景view不用设置尺寸, backgroundView的优先级 > backgroundColor)
UIImageView *bgView = [[UIImageView alloc] init];
bgView.image = [UIImage imageNamed:@"buttondelete"];
// bgView.backgroundColor = [UIColor redColor];
cell.backgroundView = bgView; UIView *selectedbgView = [[UIView alloc] init];
selectedbgView.backgroundColor = [UIColor greenColor];
cell.selectedBackgroundView = selectedbgView;
return cell;
}
最新文章
- Alpha版本十天冲刺--Day6
- android 生成.keystore文件
- c++句柄设计
- IE 下JS和CSS 阻塞后面内容总结
- Docker Resources
- 点击图标 标记为星标记事mac中修改默认的apache网站根目录位置
- [wordpress]后台自定义菜单字段和使用wordpress color picker
- [OpenSource]浅谈.Net和Java互相调用的三种方式
- linux内核学习-
- 【动态规划】POJ 1161 &; ZOJ1463 &; XMU 1033 Brackets sequence
- unison实时双向数据同步
- 大数据系列修炼-Scala课程03
- C#私房菜[二][提供编程效率的技巧]
- laravel 嵌套的渴求式加载
- ios访问web页面<;div>;点击事件不起效果,以及alert()显示url的解决办法
- input按钮使用方法
- React 系列教程
- [leetcode]38. Count and Say数数
- Python 多线程、多进程 (三)之 线程进程对比、多进程
- 首次使用Vue开发