Ampers4nd
Ampers4nd

Reputation: 785

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?

Upvotes: 5

Views: 2783

Answers (3)

Marchy
Marchy

Reputation: 3714

In Xcode look for the 'Keyboard Look' attribute in the Text Input Traits section of the Attributes Inspector. Can toggle between Light/Dark.

enter image description here

Upvotes: 0

Victor C.
Victor C.

Reputation: 191

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.

Upvotes: 1

Matt Wilding
Matt Wilding

Reputation: 20153

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).

Upvotes: 6

Related Questions