uitableviewcell setSelectedBackgroundView
i have app with splitviewcontroller , in master view of splitview i have uitableview and in detail view i have image gallery .which shows large image of the item selected in cell of uitable view of master view.
i also have previous next button in image gallery so that user can go to previous or next photo ie in detail view of split view.
now i want to set selected to cell of tabl开发者_运维知识库eview in master view of splitview when user tap next or previous in detail view.
i must be able to setSelectedBackgroundView of uitablecell in master view from detail view in splitview
any help or tutorial or link or idea is highly appreciated.
I would connect the Back/Next buttons to the same view controller that supplies data to the UITableView. The actions for back and next would then simply need to use -indexPathForSelectedRow
to find the currently selected cell and then -selectRowAtIndexPath:animated:scrollPosition:
to make your UITableView select the new one.
Just to be clear:
Your UIViewController (your custom subclass) would have:
@property(nonatomic, retain)IBOutlet UITableView *tableView; // An IBOutlet to the table
- (IBAction)next; // tells the tableView to select the next cell
- (IBAction)previous; // tells the tableView to select the previous cell
精彩评论