Tôi đang làm việc vào Custom Keyboard ApplicationLàm thế nào để thiết lập nền khác nhau của các phím dành cho Android Tuỳ chỉnh Keyboard
Đây là mã cho màu nền của input.xml
trong 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());
}
Tôi không biết cách đặt hình nền cho khóa cụ thể.
Tham khảo http://stackoverflow.com/questions/15789997/how-to-ch này ange-background-color-of-key-cho-android-soft-keyboard –
tôi không nhận được mẫu này đúng cách nhiều u có thể xin vui lòng cho biết làm thế nào tôi sẽ thiết lập các phím màu sắc khác nhau? – user
Tôi cần đặt nền cho nền khóa cụ thể thay vì cùng một hình nền chính cho toàn bộ bàn phím. tôi cần khẩn trương – user