How can I set backgrounds for each key on the android keyboard.
KeyboardView android:keyBackground provides one background for all keys. But I want to set different backgrounds for every key.
How can I set backgrounds for each key on the android keyboard. KeyboardView android:keyBackground
Share
If you are writing your own IME, try using a drawable for the FOREground image (with android:keyIcon in XML or Key.icon in Java) that is equal to the size of the entire key. This is essentially equivalent to setting the background image of a single key. Of course you will also have to include the foreground in your image.
You will also have to use a background image with no padding, so it doesn’t peek around the edges. See this posting for details on how to do this: how does a 9patch png work in android apps
Barry