UITableViewCell分割线左侧不能到达边缘的解决方案
2016-02-17 14:43
447 查看
由于UITableView内部使用了marginLayout进行布局,默认了左侧大概15个像素的空白区域,如果不需要这个左侧边距,需要添加如下代码。
-(void)tableView:(UITableView )tableView willDisplayCell:(UITableViewCell )cell forRowAtIndexPath:(NSIndexPath *)indexPath
{if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cell setPreservesSuperviewLayoutMargins:NO];
}
}
相关文章推荐
- iOSUIBezierPath
- UIImagePickerController使用小结
- UIView的bounds和frame学习
- error :Java.exe finished with non-zero exit value 1(或2)
- 关于FineUI使用问题的一点记录。
- FrexibleSearch Query语法
- IOS中Key-Value Coding (KVC)的使用具体解释
- onInterceptTouchEvent dispatchTouchEvent requestDisallowInterceptTouchEvent
- UINavgationController
- AndroidStudioTutorial_160217S001_简单UI
- UIControlEvent
- UICollectionView实现无限轮播
- iOS 解决页面按钮同时点击,同时触发问题 设置所有UIButton的ExclusiveTouch属性为YES
- HDU 1159:Common Subsequence
- java建造者模式(Builder)
- UIToolBar的使用
- 学习UITextField忽略掉的细节
- [leetcode] 334. Increasing Triplet Subsequence
- Qt使用教程之使用Qt Quick UI表单(二)
- 2016太原UI设计师告你去公司我们涉猎哪些工作?