Reputation: 6697
I use the following code in my app when user click on a button :
[self.navigationController setNavigationBarHidden:NO animated:YES];
The appearance animates normally on iPhone but not on iPad. Do you know why ?
Upvotes: 1
Views: 3349
Reputation: 70997
Do check the other code you have written along with the properties of your view. I use this fragment in my universal apps and it works fine on both the iPhone and iPad. So looks like some other setting (probably autosizing properties??) of your views are causing this.
Upvotes: 1
Reputation: 1457
This code is working fine for me. I try with navigation templete for iphone and then that project upgrade for the ipad for two specific device. and run in ipad. Then navigation bar is hide/show with same animation like iphone app does.
try this. May you get more idea.
Thanks,
MinuMaster
Upvotes: 0
Reputation: 7865
Are you sure you're invoking this in the context of the Main Thread ?
Upvotes: 1
Reputation: 1313
The best solution here may be to put self.navigationBar.hidden = NO;
in the -viewWillAppear:
method of the UIViewController where you dont wish to have the bar perpetually hidden.
EDIT:
i found this, may help you;
if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
{
CGRect rect = self.navigationController.navigationBar.frame;
rect.origin.y = rect.origin.y < 0 ?
rect.origin.y + rect.size.height
: rect.origin.y - rect.size.height;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
self.navigationController.navigationBar.frame = rect;
[UIView commitAnimations];
}
else
{
[self.navigationController setNavigationBarHidden:shouldHide animated:YES];
}
Upvotes: 3