Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change tint color of keyboard for UITextField

I would like to set a custom color for the keyboard that is associated with a UITextField. I see that I can set the UIKeyboardAppearanceType, but I would like to be able to set the color to arbitrary color, rather than just change to a different default setting. I was hoping it would be as simple as something like this:

keyboard.tintColor = [UIColor colorWithRed:...]

Any suggestions?

like image 458
Ampers4nd Avatar asked Feb 14 '12 23:02

Ampers4nd


2 Answers

There's no public API to access the system keyboard, so you're out of luck without re-writing UIKeyboard from scratch (which is a bad idea), or finding some private API to do the job (which is a bad idea if you want to submit to the App Store).

like image 78
Matt Wilding Avatar answered Nov 15 '22 06:11

Matt Wilding


You could use Alert style keyboard and place a view in the background with a background color of your choice. This will make the keyboard a different color.

like image 22
Victor C. Avatar answered Nov 15 '22 06:11

Victor C.