简体   繁体   中英

iPad Split View in Portrait Mode - Popup Button Title

I just want to change the title in my iPad split view application of the button that initiates the Popover in portrait mode (showing the master view). I cannot, for the life of me, figure out how to reference this button. I started the application by creating a new project using the master detail application template (iOS 5 and storyboards) and most of the interface code began in the storyboard file. Any help is appreciated.

Inside your detail view you'll find a delegate method of your split view wich is for adding the new button in portrait mode (there are also similar methods wich are maybe used - but they all have the UIBarButtonItem* argument):

-(void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc
    {
        barButtonItem.title = @"Your custom title goes here";
        [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
        self.masterPopoverController = pc;
    }

And that's it - you're done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM