在将我的 nexus 4 从 Android 4.3 升级到 4.4(Kitkat) 之前,我可以使用 BackSpace 按钮删除我在 TextInput 中加载时转换的默认文本。奇怪的是,现在我无法在使用默认键盘(Google 键盘)时删除此 TextInput 的文本,但可以与 Google Play 上提供的其他键盘完美配合。我不知道这是操作系统问题还是我的代码需要修改或可能需要升级到 Kivy。
我的代码如下所示(以 kv 为单位):
TextInput:
id:txt_from_mail
font_size: root.height * .044
size_hint: (None,None)
size: root.width*.65,root.height*.0833
background_color:(1,2,0.7,0.9)
foreground_color: (.2,.4,.5,.9)
padding_y:self.height*.12
text:"YourGmail@gmail.com" # this is the text that i cannot delete or modify
multiline:False
on_focus:root.clear_mail_feedback()
在 Python 中,该函数如下所示:
def clear_mail_feedback(self):
self.the_mail_feedback.text="" # this is a label in my form that gives text feedback to users
编辑:我还可以添加其他发现。在 TextInput 中输入文本,将应用程序置于后台,回调应用程序,并尝试编辑您的文本,但您做不到!这可能是 latinIME 的问题吗?使用 native 编码???无知...
最佳答案
这是 kitkat、kivy 的一个已知问题。有一个临时 hack/fix here
关于Android 4.4 退格键不修改 Kivy TextInput 中的默认文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20262201/