我有一个 iPad 应用程序,其中嵌套UIPopoverController
了一个,因此它可以有一个带有“完成”和“取消”按钮的标题栏。UINavigationController
在iOS7中,默认情况下按钮似乎没有出现一些小故障(有时如果我旋转设备并再次返回,它们会重新出现,或者我认为如果我切换到另一个应用程序然后再次返回)。奇怪的是,您仍然可以与他们互动,只是看不到他们!有没有其他人经历过这种情况,如果有,你有解决方法吗?
KNMultiItemSelector * selector = [[KNMultiItemSelector alloc] initWithItems:sortedItems
preselectedItems:nil
title:@"Select contacts"
placeholderText:@"Search"
delegate:self];
selector.useTableIndex = YES;
selector.allowSearchControl = YES;
selector.modalPresentationStyle = UIModalPresentationFormSheet;
UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:selector];
selector.view.frame = CGRectMake(0, 0, self.view.frame.size.width - 40, self.view.frame.size.height - 40);
nav.contentSizeForViewInPopover = CGSizeMake(self.view.frame.size.width - 40, self.view.frame.size.height - 40);
self.popover = [[UIPopoverController alloc] initWithContentViewController:nav];
self.popover.delegate = self;
[self.popover presentPopoverFromRect:CGRectMake(self.view.frame.size.width * 0.5 + self.tableView.contentOffset.x, 20 + self.tableView.contentOffset.y, 0, 0)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
KMultiItemSelectorinitWithItems:
方法像这样初始化右键:
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(didFinish)];