我目前正在使用一个 UISplitViewController,而不是这个默认的滑出菜单,我想要一个真正的 UIPopover,如果我点击 UIBarButtonItem 就会出现。我必须做什么,是否有一种简单的配置方法?
最佳答案
您首先需要用可用于显示弹出窗口的按钮覆盖左栏按钮项。 使用以下 -
UIBarButtonItem *barBtn = [[UIBarButtonItem alloc] initWithTitle:@"Popover" style:UIBarButtonItemStylePlain target:self action:@selector(presentPopover:)];
self.navigationItem.hidesBackButton = NO;
self.navigationItem.leftBarButtonItem = nil;
现在您可以使用添加的目标,然后根据您的选择执行关联的功能。
-(IBAction)presentPopover:(id)sender
{
// Perform your operations
}
关于ios - 使用 UISplitViewController 时是否可以显示真正的 Popover 而不是默认的滑出式菜单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17989481/