我正在嘗試為我在 swift 中使用的數字鍵盤創建一個工具列,但使用以下代碼收到此警告:
'blackTranslucent' was deprecated in iOS 13.0: Use UIBarStyleBlack and set the translucent property to YES instead
我沒有看到任何型別的屬性UIBarStyleBlackwith UIToolBar,我怎樣才能擺脫這個警告?
let doneToolbar: UIToolbar = UIToolbar(frame: CGRect(x: 0, y: 0, width: 320, height: 50))
doneToolbar.barStyle = .blackTranslucent
uj5u.com熱心網友回復:
您可以使用 doneToolbar.isTranslucent = true
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/375493.html
