파일에 일부 속성을 추가했습니다. attr.xml
. 여기에 해당 코드 :Android : 경우에 따라 스타일을 인식하지 못함
<?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 **에서 제거하고,이 옵션을 선택합니다 : http://stackoverflow.com/questions/6675403/r -styleable-can-be-resolved-why/6675824 # 6675824 –
미안하지만, 첫 번째 경우에는 여전히 사용할 수 있습니다. 날 설명해 줘. 고마워요 :) – hqt