1
我試圖讓我的UIPopOver do this,它只是顯示爲一個藍色的UIPopOver沒有我的內容顯示。這是到目前爲止我的代碼在我的主視圖控制器的.m文件:UIPopOver不顯示內容?
- (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];
}