问题
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