Question about drawing a highlighted UITableViewCell
I am looking at the TableViewSuite example code from Apple. In Suite 5 - they have a UITableViewCell which has another UIView within it. That view开发者_StackOverflow社区 is responsible for drawing the view. My question is about how it handles highlighting. In the UIView they have the following:
- (void)setHighlighted:(BOOL)lit {
// If highlighted state changes, need to redisplay.
if (highlighted != lit) {
highlighted = lit;
[self setNeedsDisplay];
}
}
My question is - how does this get called? I searched for highlight and there aren't many matches in the project. Does a UITableViewCell call setHighlighted on all of its subviews when it has setHighlighted called on itself? I'm assuming this is what is happening but can't find any documentation that states this.
I'm pretty sure the table view cell recurses into its subviews. I recall having a subview in a custom table cell that would highlight if the cell was highlighted.
精彩评论