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

作者: 小码农_gjw | 来源:发表于2016-06-12 15:00 被阅读451次

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];

}

相关文章

网友评论

    本文标题:TableView使用过程中遇到的那些坑

    本文链接:https://www.haomeiwen.com/subject/udbedttx.html