Hiding a subTabBar and it should show when header is clicked in a tableView, for iPad application
I am working on an iPad application, it has popover, in popover it shows a tableView, in tableview it has different groups and a subTabBar, but it should show that subTabBar when header is开发者_开发问答 clicked and it should hide subTabBar when again that header is clicked. Can anyone tell me how to do that.
Thanks.
What about an invisible button overlaying the Header? This would give you an Event you could react to with either hiding/showing the tab bar (if possible) or show a new View Controller instance without animation that shows the bar.
Edit:
To answer your comment: This is not so much about code.
Simply put a UIButton
over the Header in interface builder, go to Attributes Inspector and set the button to custom (which makes it invisible).
The related code could look something like this:
//test.h
@interface test : UITableViewController {
}
- (IBAction)customButtonPressed;
@end
then the implementation:
//test.m
BOOL isHidden =NO;
@implementation
-(IBAction)customButtonPressed{
//Do the hiding or view swiching
if(!isHidden){
[self hideBar];
}
else{
[self showBar];
}
isHidden=!isHidden;
}
Then back in the inspector just drag from the touchUpInside at Connection Inspector to Files owner and choose the customButtonPressed.
精彩评论