我是 android 的初学者开发人员,我下载了示例 SoftKeyboard 的源代码
https://android.googlesource.com/platform/development/+/android-2.3.3_r1.1/samples/SoftKeyboard https://android.googlesource.com/platform/development/+/android-2.3.3_r1.1/samples/SoftKeyboard
首先我遇到的问题是
“当输入一个或多个字母,然后切换到符号键盘并输入一个数字时,先前输入的一个或多个字母将被删除”
我通过删除修复了它else
从方法handleCharacter()
in SoftKeyboard.java
private void handleCharacter(int primaryCode, int[] keyCodes) {
if (isInputViewShown()) {
if (mInputView.isShifted()) {
primaryCode = Character.toUpperCase(primaryCode);
}
}
if (isAlphabet(primaryCode) && mPredictionOn) {
mComposing.append((char) primaryCode);
getCurrentInputConnection().setComposingText(mComposing, 1);
updateShiftKeyState(getCurrentInputEditorInfo());
updateCandidates();
}
//The following line was moved out of the else clause
getCurrentInputConnection().commitText(
String.valueOf((char) primaryCode), 1);
}
但现在我有另一个问题......
输入字母时按空格或删除,该字母加倍(例如:a > aa)。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)