iPad IOS Popover通过UIBarButtonItem呈现UIBarButtonItem?

时间:2012-04-05 12:50:57

标签: ipad uipopovercontroller uibarbuttonitem

我有UIBarButtomItem按下时显示弹出窗口:

//add help button
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Help", @"Help") style:UIBarButtonItemStylePlain target:self action:@selector(showInfoBubble:)] autorelease];
infoBubblePopOverVisible = NO;
self.infoBubblePopOverController = nil;

这是show info bubble:

- (void) showInfoBubble: (id) sender {
[self dismissPopoverControllerExplicitly];

if (self.infoBubblePopOverController == nil) {
    InfoBubbleViewController *controller = [[InfoBubbleViewController alloc] initWithNibName:@"InfoBubbleViewController" bundle:nil];
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:controller];
    self.infoBubblePopOverController = [[UIPopoverController alloc] initWithContentViewController:navigationController];
    [controller release];
    [navigationController release];
}

//present popOverController
[self.infoBubblePopOverController presentPopoverFromBarButtonItem:self.navigationItem.leftBarButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
infoBubblePopOverVisible = YES;

}

但是当呈现的popover部分覆盖barbuttomitem时:

enter image description here

我该如何解决这个问题?

0 个答案:

没有答案