iOS 13 UIToolBar 风格

标签 ios swift ios13 uitoolbar

我正在尝试为我在 swift 中使用的数字键盘创建一个工具栏,但使用以下代码收到此警告:

'blackTranslucent' 在 iOS 13.0 中已弃用:使用 UIBarStyleBlack 并将 translucent 属性设置为 YES

我在 UIToolBar 中没有看到任何 UIBarStyleBlack 类型的属性,如何摆脱此警告?

let doneToolbar: UIToolbar = UIToolbar(frame: CGRect(x: 0, y: 0, width: 320, height: 50))
doneToolbar.barStyle = .blackTranslucent

最佳答案

您可以使用doneToolbar.isTranslucent = true

关于iOS 13 UIToolBar 风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70248119/

相关文章:

ios - 为什么实体不能具有一对一强制逆关系的唯一性约束?

ios - 在 XCode 单元测试中测试导航

ios - 如何在 Cordova 中进行临时构建(带有分发证书/配置文件的 iOS 平台)?

ios - 如何使用 iOS 13 在 iOS 设备中获取 SSID

iphone - 如何为网络浏览器创造历史

swift - 保存为包(带有文件包装器)和 icloud 驱动器的文件,在通过电子邮件发送时是否被压缩?

ios - 如何在 SwiftUI 列表/ForEach 中动态创建部分并避免 "Unable to infer complex closure return type"

ios - 自定义 MKAnnotationView 的标注未显示

ios - 如何更改 iOS 13 中 tabBar 的框架?

ios - 在 iOS 13 上读取 Mifare Ultralight NFC 标签时出现 "Tag connection lost"错误