Using this code on iOS 7 results in the separator view getting covered or shortened:
cell.accessoryType = UITableViewCellAccessoryCheckmark;
How can I fix the separator view?
I'm using prototype cells, but I'm not subclassing them.
[EDIT]
Here is the relevant code from cellForRowAtIndexPath:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
if (indexPath.section == kDefaultViewSection){
NSArray *defaultViewNames = @[LQSettingsSentenceView, LQSettingsFullTextView, LQSettingsFlashcardsView];
NSString *preferredViewName = [LQSettings valueForKey:LQSettingsPreferredLessonView];
if ([defaultViewNames[indexPath.row] isEqualToString:preferredViewName]){
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section != kDefaultViewSection){
return;
}
// Just turn all checks off for a minute
for (int x=0; x<3; x++) {
NSIndexPath *ip = [NSIndexPath indexPathForRow:x inSection:kDefaultViewSection];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:ip];
cell.accessoryType = UITableViewCellAccessoryNone;
}
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
In my case,I have disabled system-provided separator line and add my custom separator line in cell's xib.Sometimes the right checkmark covers the part of the bottom separator line.What I have done to solve the problem is that I have changed the trailing constraint to the cell
instead of the contentView
. [Not the superview]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With