我有一个弹出类来处理弹出窗口问题,但我无法弄清楚为什么iPhone 6s plus无法设置固定高度,并且相同的代码在iPhone 6s上正常工作。
如果有任何想法,请提供帮助和建议。谢谢你。
iPhone 6s的输出加:
iPhone 6s上的输出(预期输出):
弹出功能代码:
func showPopover(segue: UIStoryboardSegue?, sender: AnyObject?, controller:UIViewController, animated:Bool) {
let senderView = sender as! UIView
controller.modalPresentationStyle = UIModalPresentationStyle.Popover
controller.popoverPresentationController?.delegate = self
controller.popoverPresentationController?.sourceView = senderView
controller.popoverPresentationController?.sourceRect = senderView.bounds;
self.presentViewController(controller, animated: animated, completion: nil)
}
弹出功能调用:
if let controller = segue.destinationViewController as? TeamMenuPopupTableViewController {
controller.rosterHandler = self.homeRoster
controller.timeoutHandler = self.homeTimeout
controller.boxscoreHandler = self.homeBoxscore
controller.preferredContentSize = CGSize(width: 200, height: 132)
showPopover(segue, sender: sender, controller: controller, animated:false)
}