I can't seem to be able to get the keyboard to default to black in my code. I've tried the solutions in the other posts with no success. Not sure if I am missing something. I want it to apply to all view controllers so I want to put it in my app delegate. This is the code I believe should be doing the trick, but its not working for me.
textfield.keyboardAppearance = UIKeyboardAppearanceDark;
I don't know what your variable "textfield" is, but if it is an instance of a UITextField, then it will only set the keyboard appearance for that specific textField instance.
If on the other hand you want to set it for all UITextFields throughout your app use instead:
[[UITextField appearance] setKeyboardAppearance:UIKeyboardAppearanceDark];
somewhere after your appstart, e.g. application: didFinishLaunchingWithOptions: in your app delegate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With