【发布时间】:2019-05-17 06:38:24
【问题描述】:
所以我有一个视图控制器,它基本上是一个警报窗口,它应该是一个弹出窗口,并通过在其框架外的点击将其关闭。
但每当我调用那个 VC 时,它总是显示为全屏而不是弹出窗口。
我已经尝试了几种方法来做到这一点,如下所述。
if let exp : String = expiredVehicles[i] {
expiredVehicleNumber = expiredVehicles[i]
let popUpVC = SubscriptionExpired()
popUpVC.modalTransitionStyle = .crossDissolve
popUpVC.modalPresentationStyle = .popover // also tried other presentation styles but none work and it is still fullscreen
popUpVC.view.backgroundColor = UIColor.white.withAlphaComponent(0.8)
self.present(popUpVC, animated: true, completion: nil)
}
如果有人需要查看该 VC 的定义,我很乐意分享它
我觉得我应该提到要显示为弹出窗口的 VC 是继承 UIViewController
任何可能有帮助的见解都会很棒。
感谢您的意见
【问题讨论】:
-
能否显示截图或将popover改为overCurrentContext
-
@AtalayAsa 我通过了它并将演示样式设置为自定义并且仍然全屏,我应该放框架还是什么?因为我被打败了
-
所以你用的是 iPad 对吧?
-
@wings overCurrentContext 是我尝试的第一个,但也没有运气,还有其他想法吗?也许我应该给框架?
标签: swift popup uipopovercontroller popupwindow modalviewcontroller