UIAlertController (ActionSheet) - Unable to simultaneously satisfy constraints [duplicate]

Deadly 提交于 2019-12-10 15:16:25

问题


I'm getting this warning every time an UIAlertController action sheet is presented in a simulated phone. The code is nothing fancy.

let action1 = UIAlertAction(title: "Action 1", style: .default) { _ in }
let action2 = UIAlertAction(title: "Action 2", style: .default) { _ in }
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let alert = UIAlertController(title: "title", message: "message", preferredStyle: .actionSheet)

alert.addAction(action1)
alert.addAction(action2)
alert.addAction(cancel)

self.present(alert, animated: true)

I'm running Xcode 10.2 (10E125), Swift 5. The constraint seems out of my control but please advise if I'm doing something wrong.


回答1:


Screenshot of IB showing the icons for constraint-manipulating menus. You can also click on the constraints themselves to edit or delete them.

Check out the various drop-down menus.



来源:https://stackoverflow.com/questions/55405570/uialertcontroller-actionsheet-unable-to-simultaneously-satisfy-constraints

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!