标签:
第一步:
-(void)viewDidLayoutSubviews {
if ([_leftTableView respondsToSelector:@selector(setSeparatorInset:)]) {
[_leftTableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([_leftTableView respondsToSelector:@selector(setLayoutMargins:)]) {
[_leftTableView setLayoutMargins:UIEdgeInsetsZero];
}
}
第二步:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
[cell setSeparatorInset:UIEdgeInsetsZero];
}
}
或者
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
标签:
原文地址:http://www.cnblogs.com/KLNL100/p/4828002.html