简体   繁体   中英

Section cell shows separator on device but not in simulator

In my UITableView I set the separatorStyle to UITableViewCellSeparatorStyleNone because in each row I want to show a set of pictures and it should like a grid without any separators.

In the simulator it looks like I want it to, but on my iPad (Version 5.0.1) I get a white line at the bottom of the HeaderCell. When I change the separatorColor to black the white line changes to black, which proves that it really is the separator. So it looks like my custom section view has a separator while the rows inside the sections do not.

I can "trick" the iPad to not show the separator when I define the header's height to 99 instead of 100 but that clearly is not the way to do it.

separatorColor = [UIColor clearColor]; ?

While I don't have the exact answer to your question, perhaps I can point you in the right direction for solving this issue.

I guess you've created custom cells? It sounds to me that it has something to do with the cell frame. In the speedy table view cell code from Tweetie I remember seeing the following code:

- (void)setFrame:(CGRect)newFrame 
{
    [super setFrame:newFrame];

    CGRect bounds = self.bounds;
    bounds.size.height -= 1; // keep space for de cell seperator
    cellView.frame = bounds;
}

Perhaps Apple's default UITableViewCell code act the same when a frame is set and you could override it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM