Chinaunix首页 | 论坛 | 博客
  • 博客访问: 253924
  • 博文数量: 159
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1619
  • 用 户 组: 普通用户
  • 注册时间: 2016-01-10 19:58
文章分类

全部博文(159)

分类: Web开发

2016-01-13 20:00:13

首先在viewDidLoad方法中加上如下代码:

if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
    [self.tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
    [self.tableView setLayoutMargins:UIEdgeInsetsZero];
}

然后在willDisplayCell方法中加入如下代码:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
    [cell setSeparatorInset:UIEdgeInsetsZero];
}

这样就可以正常显示了。

原文地址:标签:      

智能推荐

阅读(794) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~