Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Black Keyboard on iOS7

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;
like image 307
Jason G Avatar asked Nov 05 '13 13:11

Jason G


Video Answer


1 Answers

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.

like image 120
alex da franca Avatar answered Nov 02 '22 23:11

alex da franca