PDA

View Full Version : Why my button hide?




ryosaeb4
Apr 11, 2011, 02:37 AM
Hi to everybody

I've a little problem on my iPad App for the popupControl.


I've define in DetailView.h

UINavigationBar *navigationBar;
@property (nonatomic, retain) IBOutlet UINavigationBar *navigationBar;


and in DetailView.m


...

- (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem {
// Add the popover button to the left navigation item.
[navigationBar.topItem setLeftBarButtonItem:barButtonItem animated:NO];
NSLog(@"You are in DetailView Portrait");
}


- (void)invalidateRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem {
// Remove the popover button.
[navigationBar.topItem setLeftBarButtonItem:nil animated:NO];
NSLog(@"You are in DetailView Landscape");
}
...



I've do it for show a navigation button in my view only when the iPad is in Portrait mode, but sometime the button disappears...


Are there other method to show a button only when the iPad is Portrait?



jnoxx
Apr 12, 2011, 06:32 AM
There is a special method build in, to check what orientation ur application is, then u can use your code :)
A simple google search could fix ur problem.