How to change keyboard background color in iOS?

前端 未结 8 1650
一整个雨季
一整个雨季 2020-12-02 16:51

I would like to know how to change the keyboard background color programmatically in iOS? The background is normally grey but I have already seen black background (behind le

相关标签:
8条回答
  • 2020-12-02 17:33

    To change it globally, you can use appearance proxy in AppDelegate... I've tested it in iOS 8, Swift:

    UITextField.appearance().keyboardAppearance = UIKeyboardAppearance.dark
    
    0 讨论(0)
  • 2020-12-02 17:36

    For the dark background use:

    mytextfield.keyboardAppearance = UIKeyboardAppearanceAlert;
    

    Read to find more information about UITextInputTraits (use UIKeyboardAppearanceDark at iOS 7+).

    0 讨论(0)
提交回复
热议问题