내 컨트롤에 대한 사용자 지정 특성을 만들려고합니다. 여기 내 attrs.xml이있다 : 루트에 내 테스트 응용 프로그램에서참조 형식의 Xamarin 사용자 지정 특성이 작동하지 않습니다.
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<declare-styleable name="ImageView">
<attr name="testcustom" format="reference"/>
</declare-styleable>
</resources>
,이 네임 스페이스의 xmlns를 추가 TestCustom = "http://schemas.android.com/apk/res-auto"나중에
내 레이아웃 파일에서 이미지보기가 있습니다
<ImageView
android:src="@drawable/Icon"
TestCustom:testcustom="@drawable/Icon"/>
첫 번째 android : src 속성은 훌륭하지만 TestCustom이 작동하지 않습니다.
주어진 오류는 "어떤 자원이 여기에 무슨 일이 일어나고 있는지 ... 그 (@ 값 'testcustom'에서 드로어 블/사진 아이콘)을
주어진 이름과 일치 그래서 발견? 누구나 어떤 아이디어가?
을
xmlns : TestCustom ??을 지정 했습니까 ?? – sJy