Petit probléme pour novice
kanon22
-
BunoCS Messages postés 15922 Date d'inscription Statut Modérateur Dernière intervention -
BunoCS Messages postés 15922 Date d'inscription Statut Modérateur Dernière intervention -
bonjour,
j'essaye de suivre le tuto du site du zero mais le probélme c'est qu'il est vieu et qu'il concerne une veille version d'android(1.5) alors que moi je suis obligé d'utilise le 4.0, donc tous n'est pas pareil. et là mon probélem c'est que quand je clic sur <res><layout><activity_main>, ça me donne l'interface graphique.mais a chaque fois (sans faire expret) j'en sors pour avoir le code XML qui ressemble a ça
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.bijour.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="114dp"
android:text="@string/hello_world" />
</RelativeLayout>
et donc la question est comment je passe de ce code a l'interface graphique sachant que j'utilise eclipse????
j'essaye de suivre le tuto du site du zero mais le probélme c'est qu'il est vieu et qu'il concerne une veille version d'android(1.5) alors que moi je suis obligé d'utilise le 4.0, donc tous n'est pas pareil. et là mon probélem c'est que quand je clic sur <res><layout><activity_main>, ça me donne l'interface graphique.mais a chaque fois (sans faire expret) j'en sors pour avoir le code XML qui ressemble a ça
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.bijour.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="114dp"
android:text="@string/hello_world" />
</RelativeLayout>
et donc la question est comment je passe de ce code a l'interface graphique sachant que j'utilise eclipse????
2 réponses
-
Hello,
Pas très clair ce que tu racontes... ;)
Pour alterner entre le code XML et l'éditeur graphique, il faut que tu regardes en bas de ta zone de texte: tu devrais avoir 2 onglets:

-
Dans ton explorateur de projet, tu fais un clic droit sur ton fichier de layout, et tu choisis "Open With > Android Common XML Editor"