tableViewCell 下划线 长度设置为屏幕的宽

2014-12-09 0 203
tableViewCell 下划线 长度设置为屏幕的宽
//加上这写代码 ios7-8


-(void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        [tableView setSeparatorInset:UIEdgeInsetsZero];
    }
    
    if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
        [tableView setLayoutMargins: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];
    }
}

遇见资源网 objective-c tableViewCell 下划线 长度设置为屏幕的宽 http://www.ox520.com/15215.html

上一篇: IOS新闻APP
常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务