String title = context.getString(R.string.title)
Color color = context.getResources().getColor(R.color.title)
|
|
L’API n’est pas tout à fait celle de Java, pas accès à Jaxb, classes redéfinies (Color par exemple). |
String title = context.getString(R.string.title)
Color color = context.getResources().getColor(R.color.title)
Oui, c’est bien le sujet de cette partie du cours
Toute l’arborescence est basée à partir de la classe View
Ou comment mettre des trucs dans d’autres trucs
Composants graphiques et contrôles.
En parler c’est bien, les construire c’est mieux.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I am a Button" />
</LinearLayout>
Vous pouvez attaquer le premier vrai TP et mettre au point vos premières interfaces.