Hide/show navigationbar and tabbar onclick
HI all,
u all must have notices in iphone photo gallery, wen u open pic, 开发者_运维百科the tabbar and navigation bar do some hide and show functionality. wen we tap, both appears and after sometime, they get disaapaer..
I want to do exactlly like that, how can i do it??? wen user taps, both gets appear and after a dealy of say 5 sec, they get disaapear.
regards
it is toolbar not tabbar.
in .h file
IBoulet UINavigationController *navigationController;
IBoulet UIToolBar *toolbar;
connect IBoulet in in XIB
in .m file
- (void)viewDidLoad {
[super viewDidLoad];
[navigationController setNavigationBarHidden:YES];
toolbar.hidden = TRUE;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
if (touch.tapCount == 2) {
[navigationController setNavigationBarHidden:NO];
toolbar.hidden = FALSE;
[NSTimer scheduledTimerWithTimeInterval:(1.0) target:self selector:@selector(hideBar) userInfo:nil repeats:NO];
}
}
- (void)hidebar
{
[navigationController setNavigationBarHidden:YES];
toolbar.hidden = TRUE;
}
If you're using priyanka's code, the toolbar.hidden = TRUE
(all caps!) and fix that everywhere else as well.
The accepted values for a BOOL are YES, NO, TRUE, FALSE, 0, and 1.
精彩评论