Android change background of key dynamically

Posted by Wouter on Stack Overflow See other posts from Stack Overflow or by Wouter
Published on 2012-06-23T15:10:52Z Indexed on 2012/06/23 15:15 UTC
Read the original article Hit count: 209

Filed under:
|

I'm building a custom keyboard in android.

My input.xml:

<com.mykeyboard.MyKeyboardView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/keyboard"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true" 
    android:keyBackground="@drawable/keybg"
    />

All the keys do have the same background. Now I'm trying to dynamically change the background of one single key. Is this possible?

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml