Android构成特定文本字段的伪造键盘
我有一个屏幕,其中一些textfields
我想显示一个“假”键盘。键盘应该能够拥有我喜欢的任意数量的按钮,并可以按照我想要的方式显示。如下所示。

那么我的问题是如何完成这样的事情?
是否有可能以某种方式覆盖键盘的接口,因此您消耗输入并可以显示“假”键盘ND,然后在单击时删除“假”键盘使用普通键盘的任何其他textfield
上的返回按钮?
还是我必须使用自定义回调创建自定义@composable
textView ,还可以手动渲染文本光标?
I have a screen where some textfields
I want to show a 'fake' keyboard. The keyboard should be able have as many buttons as I like and be displayed however I want. Just as shown below.
My question then is how do you accomplish something like this?
Is it possible to somehow override the interface to the keyboard so you consume the input and can display a 'fake' keyboard nd then remove the 'fake' keyboard when clicking on the back button on any other textfield
which uses the normal keyboard?
Or do I have to create a custom @Composable
or TextView
with custom callbacks, and also render the text cursor manually?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以实现自己的
textInputService
或提供null
以完全禁用默认输入服务:其中
mytextinputservice
shist of:You can implement your own
TextInputService
or providenull
to completely disable the default input service:where
myTextInputService
is something like:由于
localTextInputService
现在已弃用,因此您可以尝试使用以下方式:Since
LocalTextInputService
is deprecated now, you can try using this: