iOS 8以上uitableviewcell的分割线左边对齐
2016-01-05 16:02
417 查看
为了在iOS8以上的cell使cell的分隔线采用左对齐方式,需要在
cellForRowAtIndexPath方法内添加如下代码:
cell.separatorInset =
UIEdgeInsetsZero;
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if([cell
respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cell setPreservesSuperviewLayoutMargins:NO];
}
亲测可行;
参考链接:http://blog.csdn.net/smking/article/details/46694681
cellForRowAtIndexPath方法内添加如下代码:
cell.separatorInset =
UIEdgeInsetsZero;
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if([cell
respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cell setPreservesSuperviewLayoutMargins:NO];
}
亲测可行;
参考链接:http://blog.csdn.net/smking/article/details/46694681
相关文章推荐
- UILabel自适应高度和自动换行
- android View Hierarchry for UI
- ArcGIS 中UniqueValueRenderer和SimpleRenderer的异同点
- 源码推荐(01.05B):控件悬停,UICollectionView滚动加载页面
- QUESTION 169 A database has three online redo log groups with one member each. A redo log member wit
- easyui tree onloadsuccess事件的心得
- easyui tree onloadSuccess 事件心得
- Power Builder的学习
- IOS学习之UITableViewCell动态计算高度(IOS8)
- 获取 request 中 json 数据
- requestLayout, invalidate和postInvalidate的异同
- 使用cordova/phonegap 开发应用前请阅读,环境搭建,UI选择,低端机性能问题解决
- LeeCode - Unique Binary Search Trees
- iOS 密码输入框(UITextField)
- Word Frequency
- poj 2034 Anti-prime Sequences(dfs)
- easy ui window 相关属性
- 解决ORA-00824: cannot set sga_target due to existing
- mac xcworkspace xcodebuild
- Request failed: unacceptable content-type: text/html" AFNetworking - 芒果iOS开发