我正在为UIAlertController
这样的属性设置:
alertController.modalPresentationStyle = .popover
alertController.popoverPresentationController?.sourceView = sourceView
alertController.popoverPresentationController?.sourceRect = sourceView.bounds
这呈现alertController
在iPad显示酥料饼如预期,与酥料饼的箭头中的确切中心尖端sourceView
,如所预期。然而,这掩盖了我的部分内容sourceView
。有什么我可以做的,这样内容就不会被覆盖?例如,如果箭头指向下方,则箭头尖端将位于 my sourceView
. 如果箭头朝上,箭头尖端将在我的sourceView
. 我可以操纵sourceRect
,但我无法提前知道箭头方向将是什么。
箭头应该指向 sourceRect 相对于 sourceView 的外部。当您将 sourceView.bounds 作为应该是整个源视图的 sourceRect 时。所以不应该重叠。
在那里设置一个断点并逐步执行并验证一切都如您所愿。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句