ios - 如何在 UIAlertController 中隐藏标题/消息框?

标签 ios swift uialertcontroller

当使用 UIAlertController 时,如果我想呈现一个带有空标题和空消息的 UIActionSheet,标题和/或预期位置的框架消息仍然存在。

我如何更改它以便我只显示一个 ActionSheet 内容如下:

设置
登出
取消 ?

谢谢!

UIAlertController example

最佳答案

当我使用这段代码创建 UIAlertController 时,我没有标题间距。

[UIAlertController alertControllerWithTitle:nil
                                    message:nil
                             preferredStyle:UIAlertControllerStyleActionSheet];

您是为标题和消息传递 nil 还是空字符串?

关于ios - 如何在 UIAlertController 中隐藏标题/消息框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29777342/

相关文章:

ios - App Store Connect操作错误: Missing CFBundleIdentifier in path

objective-c - 如何在 iOS 中检查 CLLocation 的有效性

swift - 替换 NSTextStorage 中的 NSAttributedString 移动 NSTextView 光标

ios - 在 Swift 中,我有 2 个导航栏,但想隐藏其中一个,怎么办?

swift - 如何在 Skscene SWIFT 中呈现 UIAlert

ios - UIPageViewController 中的按钮

ios - 异步下载图像到 NSData 和缓存

swift - 我们如何在 SwiftUI 中使用 GeometryReader 获取和读取文本的大小?

ios - 在显示和关闭 `UIAlertView` 或 `UIAlertController` 时确定应用程序状态

ios - 使用完成 block 连续显示两个 UIAlertController 对象