0

ストーリー ボードの分割ビュー アプリケーションに問題があります。私はこのポップオーバーコントローラーを持っていますが、画面の上にポップする代わりにバーボタンアイテムを押すと、横から押し出されます。何かご意見は?

    - (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
{    
    barButtonItem.title = NSLocalizedString(@"Master", @"Master");
    [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
    self.masterPopoverController = popoverController;
}

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
    // Called when the view is shown again in the split view, invalidating the button and popover controller.
    [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
    self.popoverController =nil;
    // self.masterPopoverController = ;
}
4

1 に答える 1

0

これを試してみてください:

- (void)splitViewController: (UISplitViewController*)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController:(UIPopoverController*)popoverController {
barButtonItem.title = NSLocalizedString(@"Master", @"Master");
NSMutableArray *items = [[_toolbar items] mutableCopy];
[items insertObject:barButtonItem atIndex:0];
[_toolbar setItems:items animated:YES];
[items release];
self.popover = popoverController;

}

- (void)splitViewController: (UISplitViewController*)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {    
NSMutableArray *items = [[_toolbar items] mutableCopy];
[items removeObjectAtIndex:0];
[_toolbar setItems:items animated:YES];
[items release];
self.popover = nil;

}

于 2012-06-27T05:42:40.720 に答える