Ok I have a UIButton inside every row of a UITableView, and I want to fade it to alpha 0 when it begins editing. Then the opposite when it goes back to norm开发者_如何学Cal. How do I do this?
I know what methods to use but how do I access the buttons from outside tableViewcellForRowAtIndex:?
Well, actually, you can just call cellForRowAtIndexPath:
pass in the index path that you get, and get the cell, then get the button inside of the cell and voila!
- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [ tableView cellForRowAtIndexPath: indexPath ];
UIButton *button = [ cell.contentView.subviews objectAtIndex: ... ];
...
}
精彩评论