How to Prevent Shadow at the top of grouped UITableViewCell from appearing & disappearing when selected
I want to disallow selection of certain UITableViewCells in a grouped table. Using selectionStyle = UITableViewSelectionStyleNone works and so does willSelectRowAtIndexPath.
The issue is at开发者_开发百科 the top of each of the groups of cells there is a shadow that disappears when a finger touches down on the top cell and reappears when it lifts off. How do I turn it off?
Thanks =)
That shadow is from the UITableView
"Separator" dropdown in Interface Builder: "Single Line Etched". The best way to handle it is subclass UITableViewCell
to prevent the cell from changing the highlight:
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {}
[super setHighlighted:NO animated:animated];
}
For more details, check out Removing text shadow in UITableViewCell when it's selected.
精彩评论