An jedem diffrent Eingangs Layout Verwendung android: keyBackground = ".."
Beispiel:
input.xml:
<com.example.KeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:keyBackground="@drawable/blue_key"
/>
input1.xml:
<com.example.KeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:keyBackground="@drawable/red_key"
/>
dann OnCreateInputView-Methode:
@Override public View onCreateInputView() {
if(theme == 1)
mInputView = (KeyboardView) getLayoutInflater().inflate(R.xml.input , null);
else
mInputView = (KeyboardView) getLayoutInflater().inflate(R.xml.input1 , null);
mInputView.setOnKeyboardActionListener(this);
mInputView.setKeyboard(mQwertyKeyboard);
mComposing.setLength(0);
return mInputView;
}
und am Ende des Verfahrens onStartInput hinzufügen:
setInputView(onCreateInputView());
Wenn Sie es bereits getan haben und was Sie brauchen, ist einen anderen Hintergrund zu Sondertasten einzustellen. Vielleicht hilft mir die Lösung meines Problems, das ich geschrieben habe: https://stackoverflow.com/a/18354298/2683898
Viel Glück! :)
Was hast du bisher probiert? Wenn du einen Code von dem, was du versucht hast, liefern kannst, wirst du Hilfe bekommen. –
Ich habe auf input.xml und input1.xml gesetzt – user
Ich brauche Schlüsselcode zur Laufzeit, dh andere Schlüsselfarbe habe ich drei input.xml, input1.xml, input2.xml verwendet, wenn input.xml aufblasen als keycolor wird grün , blaue Kombination, wenn input1.xml die Hintergrundfarbe der Taste aufbläht, wird rot und orange ... ähnlich wie bei input2.xml, so dass ich nicht verstehe, wie das geht. – user