【问题标题】:Storyboard Popover from Button Misaligned按钮未对齐的情节提要弹出框
【发布时间】:2016-01-10 07:52:00
【问题描述】:

使用 Xcode 7,我的情节提要到 popover 的部分没有对齐。

例如,如果我只是从按钮拖动弹出框转场,箭头将对齐按钮的左上角,而不是中心。

但是,如果我直接设置按钮,那就太离谱了:

if segue.identifier == "seguePopoverSort" {
    let pop = segue.destinationViewController.popoverPresentationController!
    pop.sourceRect = btnSort.frame
    return
}

这是一款横向的 iPad 应用,但纵向也会出现同样的问题。我开启了自动布局。

有人有什么想法吗?

【问题讨论】:

    标签: ios ipad uistoryboard xcode7 uistoryboardsegue


    【解决方案1】:

    我唯一能想到的是你只是在设置你的 sourceRect。您还需要设置“sourceView”。这必须是包含您的源矩形的视图。

    如果你设置了,我相信它会解决你的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-07
      • 2018-06-16
      • 2016-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-31
      相关资源
      最近更新 更多