TableView使用过程中遇到的那些坑

1.设置tableView线条顶满格

self.tableView.separatorInset=UIEdgeInsetsZero;   // iOS7+

self.tableView.layoutMargins=UIEdgeInsetsZero;   // iOS8+

cell.separatorInset=UIEdgeInsetsZero;    // iOS7+

cell.layoutMargins=UIEdgeInsetsZero;    // iOS8+

2.样式设置

UITableViewStylePlain:系统默认样式,section之间无分割线,具有悬浮效果

UITableViewStyleGrouped:section之间有分割线,不具有悬浮效果,使用时注意设置tableView和setion的header和footer的高度

3.点击cell跳转到下一页面返回后样式仍然为选中状态

- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {

       [tableView deselectRowAtIndexPath:indexPath animated:YES];

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容