【发布时间】:2012-04-01 17:43:28
【问题描述】:
我在文件attr.xml 中添加了一些属性。这是它的代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="gallery_view">
<attr name="android:galleryItemBackground"/>
</declare-styleable>
<declare-styleable name="Dot">
<attr name="color" format="color"/>
<attr name="radius" format="dimension"/>
</declare-styleable>
</resources>
但我不知道为什么当我使用时:
R.styleable.gallery_view_android_galleryItemBackground:没有错误。
R.styleable.Dot_color 会注意到错误,因为在 R 文件中看不到该字段。
请帮我解决这个问题。
谢谢:)
【问题讨论】:
-
android.R.styleable 类及其字段已从公共 API 中删除,请检查:stackoverflow.com/questions/6675403/…
-
对不起,但在我的第一种情况下,我仍然可以使用它。请为我解释一下。谢谢:)
标签: android attributes styleable