Change Android Softkeyboard Sample Designs, Button And Background Images
I'm building a custom keyboard by modifying the android softkeyboard sample from the SDK. I want to change the images of the buttons and the backgrounds but I can't figure out wher
Solution 1:
in onClick method you need to change the Button's image, this way..
public void onClick(View v) {
if(v==buttonName){
buttonName.setBackgroundResource(R.drawable.imageName);
}
}
The keyboard background color can be changed in input.xml using android:background
Solution 2:
You need to edit the file res/xml/qwerty.xml
.
You can check the documentation for Keyboard and the Keys. The last one defines what is shown on the keys (does not look like you can change the background though).
Solution 3:
You need to edit the file
res/layout/input.xml
A sample input.xml could look like this.
<com.example.keyboard.LatinKeyboardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@drawable/keyboardbackground"
android:keyBackground="@drawable/samplekeybackground"
android:keyPreviewLayout="@layout/input_key_preview"
android:keyTextcolor="@android:color/black"/>
there are few more attributes that can be found in the KeyboardView documentation.
Post a Comment for "Change Android Softkeyboard Sample Designs, Button And Background Images"