Shishir.bobby
Shishir.bobby

Reputation: 10984

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

Upvotes: 1

Views: 1424

Answers (2)

priyanka
priyanka

Reputation: 2076

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;
}

Upvotes: 2

MishieMoo
MishieMoo

Reputation: 6680

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.

Upvotes: 1

Related Questions