문제

I am using UITabelViewController and static cells in iOS 7.1. I am seeing desired separator in the storyboard, but not in the simulator. This drives me crazy.

Storyboard Screenshot

enter image description here

Simulator Screenshot

enter image description here

I don't want the extra white line before the separator inset. But I still need the separator just like the way it is showing in Storyboard Screenshot. How to remove that extra white line? Any help would be appreciated.

I set the black color for tableView background. Still no improvement. Cells are static and are custom cells.

도움이 되었습니까?

해결책

Thanks for other answers here. I found out what causes the bug.

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    [cell setBackgroundColor:[UIColor clearColor]];
}

Here it is the bug described which is in iOS 7 versions. https://stackoverflow.com/a/18878259/1083859

다른 팁

Try this

if ([YourTableView respondsToSelector:@selector(setSeparatorInset:)]) {
            [YourTableView setSeparatorInset:UIEdgeInsetsZero];
        }

Please set the seperatorinset for table view to zero.enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top