Domanda

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.

È stato utile?

Soluzione

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

Altri suggerimenti

Try this

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

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top