2013-11-26 3 views
0

나는 자원 ID를 이미 프레임 워크에 정의 된 edittext_container를 사용하려면,이클립스에서 안드로이드 프레임 워크 리소스를 참조하는 방법?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@*android:id/edittext_container" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:padding="5dip" 
    android:orientation="vertical"> 

    <TextView android:id="@+android:id/message" 
     style="?android:attr/textAppearanceSmall" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textColor="?android:attr/textColorSecondary" /> 

</LinearLayout> 

하지만, Eclipse는 오류가 구축 :

Illegal resource reference: @*android resources are private and not always present 

어떻게 해결?

이 ID는 어쩌면 당신은 그냥 작성해야 http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/res/res/layout/preference_dialog_edittext.xml

답변

3

없이

android:id="@android:id/edittext_container" 

당신은 안드로이드 민간 자원을 참조 할 수 없습니다. 하지만 복사하여 자신의 프로젝트 리소스 폴더에 저장할 수 있습니다. 당신은 여기에 모든 https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r2.3/core/res/res/

그러나 이러한 테마/스타일이 중첩하고있을 수 있습니다 깊은 종속성을 찾을 수 있습니다

. 원본 파일에서 많은 것을 추출해야합니다.

+1

당신이 맞습니다. –

관련 문제