美文网首页
TabView分割线缺失像素的解决办法

TabView分割线缺失像素的解决办法

作者: 吞风吻雨葬落日未曾彷徨 | 来源:发表于2016-05-18 14:49 被阅读78次
    • viewDidLoad中加入:
    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
            [self.tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
        }
        
        if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
            [self.tableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];
        }
    
    • tableview协议方法里加入:
    -(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];
        }
    }
    
    

    相关文章

      网友评论

          本文标题:TabView分割线缺失像素的解决办法

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