Bonjour à tous,
Je me suis mis à Android récemment et il est désormais temps pour moi de coder ma 1ère application .
Alors pour ce faire, j'ai utilisé ce tutoriel http://developer.android.com/resourc...tabwidget.html. Tout marche bien en ce qui concerne cet exemple.
Maintenant, ce que j'aimerais, c'est ajouter un second FrameLayout et lorsque je clique sur un onglet, le texte se charge dynamiquement dans les 2 FrameLayout.
Voici à quoi pourrait ressembler mon xml qui va contenir mes 2 FrameLayoutQuelqu'un a-t-il une idée comment faire ça ?
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 <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@+id/tabTitle" android:layout_width="fill_parent" android:layout_height="40dp" android:background="#121162"> </FrameLayout> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> </FrameLayout> </LinearLayout> </TabHost>
Merci d'avance pour votre aide.
Partager