This question is different from all the others already asked here.
问题和疑问
我希望大写锁定启用就像我打开键盘时双击(或长按)shift键一样 . 另一个要求是,如果用户按下shift键,则必须禁用大写锁定 .
我已经在stackoverflow中尝试了大多数提议的解决方案,比如android:inputType = "textCapCharacters"或setAllCaps(true)但是会发生的情况是大写锁定无法禁用 . 通过上述解决方案,在按下shift时,用户将以小写字母插入一个单个字符,然后系统自动将键盘设置回大写锁定 .
这不是我想要的正确方法,我只希望在用户第一次打开keybaoard时启用大写,然后他将自己处理大写状态 .
注意
请记住,我使用"like if I double click (or long press) the shift key"启动了问题,因为使用inputType解决方案会出现这种情况:
That has not the white caps dash like if I manually enable caps lock:
1 回答
我找到了问题的解决方案!
我必须继续使用 android:inputType="textCapCharacters" 但是当用户按下shift键并以小写字母键入单个字符时,textwatcher将删除标志 textCapCharacters .
按照文字执行者的说法:
一个简单的用途是: