UIAlertController(ActionSheet)-无法同时满足约束

时间:2019-03-28 19:33:01

标签: swift constraints

每次在模拟手机中显示UIAlertController操作表时,我都会收到此警告。代码没什么花哨的。

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)

我正在运行Swift 5的Xcode 10.2(10E125)。该约束似乎超出了我的控制范围,但请告知我是否做错了事。

screen capture

1 个答案:

答案 0 :(得分:-2)

IB的屏幕截图,显示了约束操作菜单的图标。您也可以单击约束本身来编辑或删除约束。

Picture from IB

查看各种下拉菜单。

相关问题