Android:动态创建CheckedTextView

发布于 2024-08-17 15:08:24 字数 203 浏览 3 评论 0原文

如何在 android 中动态创建 CheckedTextView [无需创建新的实现]?

看来 CheckedTextView 是抽象 ...(根本没有任何意义),因为我不断收到编译时错误:“无法实例化类型 CheckedTextView”

使用 Android 1.5

How can you dynamically create a CheckedTextView in android [without creating a new implementation]?

It seems CheckedTextView is abstract ... (which does not make any sense at all) because I keep getting the compile time error: "Cannot instantiate the type CheckedTextView"

Using Android 1.5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧时光的容颜 2024-08-24 15:08:24

查看文档,该类不是抽象的并且具有构造函数。因此,您大概可以调用:

new CheckedTextView(this);

其中 this 是您的 Activity,并获取 CheckedTextView

您在使用这个时遇到过问题吗?

Looking at the docs, the class is not abstract and has constructors. Presumably, therefore, you can call:

new CheckedTextView(this);

where this is your Activity, and get a CheckedTextView.

Have you run into problems using this?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文