SO 问题来了

笔记__ 为了让分割线从头开始

2016-07-15  本文已影响22人  失忆的程序员

_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 100, SCREEN_WIDTH, SCREEN_HEIGHT - 164) style:UITableViewStylePlain];

self.automaticallyAdjustsScrollViewInsets = NO;

_tableView.delegate = self;

_tableView.dataSource = self;

_tableView.rowHeight = 100;

//为了让分割线从头开始

if ([_tableView respondsToSelector:@selector(setSeparatorInset:)])

{

[_tableView setSeparatorInset:UIEdgeInsetsZero];

}

if ([_tableView respondsToSelector:@selector(setLayoutMargins:)])

{

[_tableView setLayoutMargins:UIEdgeInsetsZero];

}

_tableView.separatorColor = [UIColor lightGrayColor];

[self.view addSubview:_tableView];

上一篇 下一篇

猜你喜欢

热点阅读