Remove SeparatorInset on iOS 8 UITableView for Xcode 6 iPhone Simulator

后端 未结 15 1988
情深已故
情深已故 2020-11-28 21:40

I found a weird white space on UITableView for iPhone 6 Simulator (iOS 8) on Xcode 6 GM. I have tried to set the SeparatorInset fr

15条回答
  •  情深已故
    2020-11-28 22:33

    My solution with just three lines of code:

    -(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)row{
        //
        // ... your code ...
        //
        if ([cell respondsToSelector:@selector(preservesSuperviewLayoutMargins)]){
            cell.layoutMargins = UIEdgeInsetsZero;
            cell.preservesSuperviewLayoutMargins = false;
        }
        return cell;
    }
    

提交回复
热议问题