简体   繁体   English

如何创建自定义键盘?

[英]How to create a custom Keyboard?

Android had deprecated the Keyboard and Keyboard view classes in API 29. Android 已弃用 API 29 中的KeyboardKeyboard view类。

How can I make a custom keyboard without these classes?如何在没有这些类的情况下制作自定义键盘?

All the tutorials and examples I found online use them.我在网上找到的所有教程和示例都使用它们。

thanks!谢谢!

Keyboard , according to the deprecation message, is just a UI widget class.根据弃用消息, Keyboard只是一个 UI 小部件类。

This class was deprecated in API level 29 .此类在 API 级别 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.此类已被弃用,因为这只是一个方便的 UI 小部件类,应用程序开发人员可以在现有公共 API 之上重新实现它。 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如果您已经依赖该类,请考虑将 AOSP 中的实现复制到您的项目中,或者自己重新实现一个类似的小部件

If you want to follow the tutorials that use it, just copy the class from the google source into your project and use it locally.如果您想遵循使用它的教程,只需将该类从 google 源代码复制到您的项目中并在本地使用即可。 Otherwise, you can customise it by creating it from scratch and giving the widget the look and feel that you want.否则,您可以通过从头开始创建它并为小部件提供您想要的外观来自定义它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM