【发布时间】:2012-02-11 17:14:10
【问题描述】:
如何在 iPhone 上的 UIPopovercontroller 中显示 NavigationController 的背景(包括标题/按钮)?
目前看起来是这样的:
在我的 PopoverView-ViewController 中:
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBar.hidden = NO;
self.navigationController.navigationBarHidden = NO;
self.navigationItem.title = @"self.navigationItem.title";
}
调用 Popover 时:
InfoView *iv = [[InfoView alloc] initWithNibName:@"InfoView" bundle:nil];
UINavigationController *uc = [[UINavigationController alloc] initWithRootViewController:iv];
self.pop = [[UIPopoverController alloc] initWithContentViewController:uc];
[self.pop setDelegate:self];
[self.pop presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:true];
应该是这样的:
【问题讨论】:
-
@Rayfleck,你也可以在 iPhone 上使用它!!你读了问题并看图片了吗???不要为时过早。
-
stackoverflow.com/questions/6371508/… -- 这就是你要找的吗?
-
@rakete - 是的,我看到了这张照片,并被它弄糊涂了。 iOS 5.0 库 UIPopoverController 类参考说:
Popover controllers are for use exclusively on iPad devices. Attempting to create one on other devices results in an exception.
标签: iphone ios cocoa-touch uikit uipopovercontroller