【问题标题】:Why my UIPopoverController is popping in this way?为什么我的 UIPopoverController 会以这种方式弹出?
【发布时间】: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


【解决方案1】:

因为您给箭头方向UIPopoverArrowDirectionAny 这意味着它可以是任何方向,所以为同质行为设置特定方向

【讨论】:

  • 谢谢,这就是解决方案!
猜你喜欢
  • 2014-08-28
  • 1970-01-01
  • 2020-06-20
  • 2014-03-21
  • 2019-09-22
  • 2012-07-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多