UIAlertController is Crashed (iPad)

后端 未结 10 1773
长情又很酷
长情又很酷 2020-12-13 17:58

I am using Xcode 6 to develop an iOS Application.

When I used UIAlertController, it can be worked well on iPhone 6 simulator, but crashes on iPad simula

10条回答
  •  醉话见心
    2020-12-13 18:43

    try this code:

    shareMenu.popoverPresentationController.sourceView = self.view
    shareMenu.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0, 1.0, 1.0)
    
    self.presentViewController(shareMenu, animated: true, completion: nil)
    

提交回复
热议问题