How do I get a disclosure indicator in my tableview header section?
I'm customizing my headers in my Tableview and I want to add a discloure indicator (arrow) to my header that is clickable, is that po开发者_JAVA百科ssible?
If you already customized your header view you can simply add a custom UIButton with an image of a discloure indicator add add it as a subview to your header view.
If you need further help you are most welcome.
EDIT Jonathan is right, the UIButton has a UIButtonTypeDetailDisclosure so there is no need for a custom image.
You can fetch the header view using
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
Then fetch the actual header view
UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
Create a button with detail disclosure
UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
Then set the frame of this button and add it to the header view
精彩评论