UIAlertController(ActionSheet)

编程入门 行业动态 更新时间:2024-10-22 17:32:05
本文介绍了UIAlertController(ActionSheet)-无法同时满足约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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)

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

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.

推荐答案

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

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

查看各种下拉菜单。

更多推荐

UIAlertController(ActionSheet)

本文发布于:2023-11-27 09:23:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637493.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:UIAlertController   ActionSheet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!