【发布时间】:2014-01-29 11:34:52
【问题描述】:
我在 iPad 上有两个按钮,可以打开两个弹出窗口。它们是用代码打开的:
CGRect frame = [self.view convertRect:self.addNewFolderButton.frame fromView:self.addNewFolderButton.superview];
[self.popover presentPopoverFromRect:frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
和
CGRect frame = [self.view convertRect:self.addNewUserButton.frame fromView:self.addNewUserButton.superview];
[self.popover presentPopoverFromRect:frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
但我的 popView 没有以相同的方式打开(与调用按钮的链接以不同的方式定位。为什么?
【问题讨论】:
-
那是因为你给了 allowedArrowDirections 为
UIPopoverArrowDirectionAny。给两者一个特定的方向,它会正常工作,例如:UIPopoverArrowDirectionUp.
标签: ios ipad uipopovercontroller uipopover