アンドロイドレイアウトxmlファイルの "android:"と "@android:"の違いは何ですか?彼らはAndroid SDKのリソースを再利用する交換可能な方法のようです。アンドロイドレイアウトxmlファイルの "android:"と "@android:"の違いは何ですか?
私が発見した唯一の違いは、次の例で説明されています。
ここでのTextViewの右端は、ここでのImageButton
<RelativeLayout
android:id="@id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#888888">
<TextView
android:id="@android:id/text1"
android:layout_alignParentLeft="true"
android:text="blah blah"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@android:id/button1" />
<ImageButton
android:id="@android:id/button1"
android:layout_alignParentRight="true"
style="@style/PlusButton" />
</RelativeLayout>
の左端と整列レンダリングされ、但し、のTextViewの右端はRelativeLayoutの右端に位置合わせされます。 TextViewはImageButtonと重なっています。
<RelativeLayout
android:id="@id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#888888">
<TextView
android:id="@android:id/text1"
android:layout_alignParentLeft="true"
android:text="blah blah"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="?android:id/button1" />
<ImageButton
android:id="?android:id/button1"
android:layout_alignParentRight="true"
style="@style/PlusButton" />
</RelativeLayout>
2つのレイアウトの唯一の違いは、@ android対?androidの使用です。どちらもエラーなしでコンパイルされます。
ありがとうございました。
可能な複製を(http://stackoverflow.com/questions/2733907/question-mark-in- xml-attributes-for-android) –