Une autre petite question... je crois que celle-ci s'applique plus sur le forum Android que sur le Forum java.
J'ai plusieurs interface graphique XML dans la même activitée. En quelques sorte un menu qui ne fait pas toute l'écran un peu comme un dialog. Cependant elles on tous le même backgroung et des boutons en communs... j'aimerais changer seulement une partie (un RelativeLayout).
Mes interface du menu sont monté grossomodo comme suit...
Pour l'instant je les appelle par setContentView(R.layout.monFichierXML) a chaque page quand on click sur le bouton next ou back.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" android:gravity="center" > <RelativeLayout android:id="@+id/LayoutMenuBackground" android:layout_width="500dp" android:layout_height="272dp" android:background="@drawable/background_menu" android:gravity="center" > <Button android:id="@+id/Button_MenuBack" android:layout_width="40dp" android:layout_height="40dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/button_back1" /> <Button android:id="@+id/Button_MenuNext" android:layout_width="40dp" android:layout_height="40dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/button_next1" /> <RelativeLayout android:id="@+id/LayoutMenuContent" android:layout_width="500dp" android:layout_height="272dp" android:background="#00000000"> //Contenu qui change d'un fichier XML a l'autre </RelativeLayout> </RelativeLayout> </LinearLayout>
Mais on vois biens que le background est reloader chaque fois ce qui n'est pas parfaitement fluide.
J'aimerais afficher la vue et ensuite changer seulement le contenu de mon RelativeLayout avec l'id @+id/LayoutMenuContent... est-ce possible ou on doit afficher tout le layout au complet chaque fois...
J'ai meme essayer setContentView(R.id.LayoutMenuContent) mais ca plante au chargement.
Merci encore.
Partager