Android中不推荐使用KeyboardView [英] KeyboardView is deprecated in android
问题描述
KeyboardView
已被API级别29的android团队弃用,而我无法找到替代方法.请让我知道是否有其他选择?
KeyboardView
has been deprecated official by android team in API level 29 and i didn't able to find the alternative way for this. Please let me know if there any alternative?
推荐答案
Google提出的唯一解决方案是复制 Keyboard.java 文件从Android AOSP到您的本地项目.通过一些自定义,我设法使其像旧的弃用的 KeyboardView
和 Keyboard
Android的类一样工作.
The only solution Google suggests is copying KeyboardView.java and Keyboard.java files to your local project from Android AOSP. With some customization I managed to make it work as old deprecated KeyboardView
and Keyboard
Android's classes.
您还将从您会注意到,它被注释为
You can notice, it is annotated as
<!-- {@deprecated Copy this definition into your own application project.} -->
Google:
该类在 API级别29 中已弃用.此类已弃用因为这只是该应用程序的一个方便的UI小部件类开发人员可以在现有的公共API之上重新实现.如果你已经依赖此类,请考虑复制从AOSP实施到您的项目中或重新实施自己也有类似的小工具
This class was deprecated in API level 29. This class is deprecated because this is just a convenient UI widget class that application developers can re-implement on top of existing public APIs. If you have already depended on this class, consider copying the implementation from AOSP into your project or re-implementing a similar widget by yourselves
这篇关于Android中不推荐使用KeyboardView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!