Eclipse를 사용하여 사용자 정의 구성 요소 (MyTextView, android.widget.TextView)를 상속받은 간단한 Android 프로젝트를 만들었습니다. 내가 파일을 만든 후 는 아래 규정 된 나는,이 클래스에 속성을 추가 attrs.xml이 :Eclipse에서 사용자 정의 속성을 표시하지 않습니다. (attrs.xml)
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mt="http://schemas.android.com/apk/res/myprogram.custom"
android:orientation="vertical"
android:layout_height="fill_parent" android:layout_width="fill_parent">
<myprogram.custom.MyTextView
android:text="MyTextView"
android:id="@+id/myTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</myprogram.custom.MyTextView>
</LinearLayout>
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="MyTextView" >
<attr name="AttributeOne" format="integer"/>
</declare-styleable>
</resources>
나는 나의 main.xml에에 선형 레이아웃 객체를 추가
main.xml을 열고 '그래픽 레이아웃'탭을 선택하여 내 구성 요소를 선택하면 사용자 정의 속성이 Eclipse의 '속성'탭에 나타나지 않지만 클래스 상속의 원래 특성 (android .widget.TextVie w)가 나타납니다.
이것은 실수였습니까? 내 맞춤 속성을 제출하는 절차는 무엇입니까? 아니면 오인입니까?
감사합니다. 루치아노.
isInEditMode의
세부 사항? 프로젝트를 다시로드하지 않는 한 테마를 추가 할 때 Eclipse의 그래픽 레이아웃이 업데이트되지 않는 것으로 나타났습니다. – Gregory
네, 그래도 작동하지 않습니다 ... – Luciano