方案一,添加UITableView的delegate:
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { // Remove seperator inset if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { [cell setSeparatorInset:UIEdgeInsetsZero]; } // Prevent the cell from inheriting the Table View's margin settings if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) { [cell setPreservesSuperviewLayoutMargins:NO]; } // Explictly set your cell's layout margins if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { [cell setLayoutMargins:UIEdgeInsetsZero]; } }
方案二,对于自定义的Cell,添加以下代码:
- (UIEdgeInsets)layoutMargins { return UIEdgeInsetsZero; }
参考链接:http://stackoverflow.com/questions/25770119/ios-8-uitableview-separator-inset-0-not-working
相关推荐
简单的UITableView的界面,用于程序中需要设置界面,供新手参考
UITableView、UITableView基本用法、UITableView详解,UITabelView常用方法
UITableView重排后设置动画引起界面布局问题分析及解决方式 http://blog.csdn.net/dql870527/article/details/20840139
主要介绍了ios8 UITableView设置 setSeparatorInset UIEdgeInsetsZero不起作用的解决办法(去掉15px空白间距)的相关资料,需要的朋友可以参考下
UITableView相关操作
NULL 博文链接:https://auauau.iteye.com/blog/650487
UITableView:隐藏删除按钮和设置删除按钮的标题对应的Demo。
UITableView通过重用单元格来达到节省内存的目的:通过为每个单元格指定一个重用标识符 reuseIdentifier 即指定了单元格的种类 以及当单元格滚出屏幕时 允许恢复单元格以便重用 对于不同种类的单元格使用不同的ID ...
(2)UITableView并不负责存储表格中的数据,而是仅仅存储足够的数据使得可以画出当前可见部分。 (3)UITableView从UITableViewDelegate协议获取配置信息,从UITableViewDataSource协议获得数据信息。 (4)所有的...
UITableView Cache - UITableView 缓存
UITableView教材 IPHONE IPAD
设置UITableView Section的背景颜色和字体颜色,很详细
UITableView 详细讲解
IOS UITableView UIcollectionView 结合
UITableView 缩进 附属视图 Cell Demo
iOS UITableView查询及索引UISEARCHBAR
UITableView 三级菜单
UICollectionView和UITableView切换
这是iPhone之UITableView入门的示例程序,具体参考: http://blog.csdn.net/htttw/article/details/7875462