我试图让我的 UIPopOver做到这一点,它只是显示为蓝色 UIPopOver 而我的内容没有显示。到目前为止,这是我在主 ViewController 的 .m 文件中的代码:
- (void)viewWillAppear:(BOOL)animated
{
self.PopOverController = [[UIPopoverController alloc] initWithContentViewController:viewController];
[super viewWillAppear:animated];
}
在我IBAction
的按钮中,
if (self.PopOverController.popoverVisible) {
[self.PopOverController dismissPopoverAnimated:YES];
} else {
PopOverView *pickerPopView = [[PopOverView alloc] init];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:pickerPopView];
[self.PopOverController setDelegate:self];
[self.PopOverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
[self.PopOverController setPopoverContentSize:CGSizeMake(320, 260)];
[self.PopOverController release];
}