Quelle est la différence entre "?android:" et "@android:" dans un androïde mise en page fichier xml? Ils semblent être interchangeables façons de réutiliser l'android SDK ressources.
La seule différence que j'ai découvert est illustré par l'exemple suivant.
Ici le TextView du bord droit est alignée avec le bord gauche de la 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>
Ici, cependant, le bord droit de la TextView est aligné avec le bord droit de la RelativeLayout. Le TextView chevauche le 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>
La seule différence entre les deux dispositions est l'utilisation de @android vs ?android. Compiler sans erreurs.
Merci beaucoup.