Why my button hide?

Discussion in 'iPhone/iPad Programming' started by ryosaeb4, Apr 11, 2011.

  1. macrumors newbie

    Joined:
    Jul 23, 2008
    #1
    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

    Code:
    ...
    
    - (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?
     
  2. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    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.
     

Share This Page