iOS UITableViewCell的分割线向左延长15(cell长度为全宽)
2024-08-30 10:03:32
iOS7情况下: tableView.separatorInset = UIEdgeInsetsZero;
iOS8、9情况下: 首先在viewDidLoad方法中加上如下代码:
if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset: UIEdgeInsetsZero];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins: UIEdgeInsetsZero];
}
然后再加上这个方法:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
最新文章
- JQM页面跳转,多种效果
- crontab 定时调度
- Visual Studio Online Integrations-Planning
- #import与@class的区别
- 【网络收集】Sql Server datetime 常用日期格式转换
- android源码编译环境的准备及编译之后使用emulator运行的方法 - 官方版
- 月見(つきみ) 夕(ゆう) SumiHui.墨虺
- SafeNet推出行业首款白盒password软件保护解决方式
- OSI模型第四层传输层--UDP协议
- 中兴iptv机顶盒破解教程图文:亲测中兴B760EV3、B860A、B860AV1.1完美安装应用!非ttl破解![转]
- 设置LISTControl控件某一行的背景和文字颜色
- window.open实现模式窗口
- 12、Java函数接口
- [js]js中函数传参判断
- 与C/C++关键字extern有关的原理
- 解决办法: RSA host key for [ip address] has changed and you have requested strict checking.
- 图论最短路——dijkstra
- 完整table
- 管理11gRAC基本命令 (转载)
- JavaScript设计模式—工厂模式