Sto lavorando su Custom Keyboard ApplicazioneCome impostare diversi sfondo di tasti per la tastiera personalizzata Android
Questo è il codice per il colore di sfondo di input.xml
in SoftKeyboard: -
@Override
public View onCreateInputView() {
Log.e("onStartInputView ","On StartInput View Called--");
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
String Backgroundcolour = preferences.getString("BackgroundColour","");
Log.e("Brithnesss- -","----"+Backgroundcolour);
if(Backgroundcolour.equalsIgnoreCase("black"))
{
this.mInputView = (KeyboardView) getLayoutInflater().inflate(
R.layout.input, null);
}else
{
this.mInputView = (KeyboardView) getLayoutInflater().inflate(
R.layout.input1, null);
//this.mInputView.setB
}
this.mInputView.setOnKeyboardActionListener(this);
this.mInputView.setKeyboard(this.mQwertyKeyboard);
return this.mInputView;
}
@Override public void onStartInputView(EditorInfo attribute, boolean restarting) {
super.onStartInputView(attribute, restarting);
// Apply the selected keyboard to the input view.
setInputView(onCreateInputView());
}
Non riesco a ottenere come impostare l'immagine di sfondo per una chiave specifica.
Consulta questo http://stackoverflow.com/questions/15789997/how-to-ch ange-background-color-of-key-per-android-soft-keyboard –
Non riesco a ottenere questo modulo in modo corretto, per favore, dimmi come impostare le diverse chiavi dei colori? – user
È necessario impostare lo sfondo per lo sfondo chiave specifico anziché la stessa immagine di sfondo chiave per l'intera tastiera. ho bisogno urgente – user