Android:在哪里可以找到 RadioButton Drawable?

Android: Where to find the RadioButton Drawable?(Android:在哪里可以找到 RadioButton Drawable?)
本文介绍了Android:在哪里可以找到 RadioButton Drawable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我正在尝试创建一个名为 CheckedRelativeLayout 的自定义视图.

Ok, I am trying to create a custom view called CheckedRelativeLayout.

它的用途与 CheckedTextView 相同,以便能够在要选择的项目列表或 Spinner 中使用它.

It's purpose is the same as a CheckedTextView, to be able to use it in a list of items you want selected or in a Spinner.

现在一切正常,我扩展了 RelativeLayout 并实现了 Checkable 接口.

It's all working fine now, I extended RelativeLayout and implemented Checkable interface.

但是,我遇到了一个非常简单的问题:在哪里可以找到 CheckedTextViewRadioButton 使用的 Drawable?

However, I am stuck on a quite simple problem: Where can I find the Drawable that CheckedTextView and RadioButton use?

我查看了两者的源代码,它们似乎使用 com.android.internal.R.嗯……这是内部的东西.所以我无法访问它.

I looked at the sourcecode of both, and they seem to use com.android.internal.R. Well... that's internal stuff. So I can't access it.

有什么方法可以获取这些 Drawable 或以某种方式解决问题?

Any way to get these Drawables or solve the problem somehow?

推荐答案

查看SDK文件夹/platforms/android-2.0/data/res/您可以通过 android.R.drawable (如果是公共的)访问它们,或者需要将它们作为可绘制对象复制到您的项目中

look under SDK folder /platforms/android-2.0/data/res/ you can access them by either android.R.drawable ( if public ) or need to copy them as drawable to your project

这篇关于Android:在哪里可以找到 RadioButton Drawable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)