0
我正在嘗試更新我的應用程序,以便它可以在iOs7上正常工作。Ios 7 popover不起作用
在iOS 5中& 6這個完美工作:
if ([segue.identifier isEqualToString:@"popover"])
{
FavoritesViewController *vc = segue.destinationViewController;
CGFloat width = 200.0;
CGRect rect = [vc.tableView rectForSection:[vc.tableView numberOfSections] - 1];
CGFloat height = CGRectGetMaxY(rect);
if ([segue isKindOfClass:[UIStoryboardPopoverSegue class]])
{
_filterPopoverController = [(UIStoryboardPopoverSegue *)segue popoverController];
[_filterPopoverController setPopoverContentSize:CGSizeMake(width, height)];
[_filterPopoverController setDelegate:self];
}
}
}
我用它來檢查,如果它的屏幕
- (IBAction)touchedFilterButton:(UIBarButtonItem *)sender
{
if (_filterPopoverController == nil)
{
[self performSegueWithIdentifier:@"popover" sender:self];
}
else
{
[_filterPopoverController dismissPopoverAnimated:YES];
_filterPopoverController = nil;
}
}
已經上,如果我刪除此行
_filterPopoverController = [(UIStoryboardPopoverSegue *)segue popoverController];
它的工作原理,但我不能設置寬度/高度,並沒有檢查它是否在屏幕上。