tlarour Posté(e) 2 septembre 2014 Share Posté(e) 2 septembre 2014 (modifié) Bonjour, je débute avec android et je ne sais pas trop comment afficher ces deux ficher XML en meme temp pour avoir un ViewPager et aussi le menu DrawerLayout sur la droite merci <?xml version="1.0" encoding="utf-8"?> <android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/pager" android:layout_width="wrap_content" android:layout_height="0dp" android:layout_weight="0.19"> </android.support.v4.view.ViewPager> <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- As the main content view, the view below consumes the entire space available using match_parent in both dimensions. --> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent"/> <LinearLayout android:id="@+id/content_linear" android:layout_width="350dp" android:layout_height="match_parent" android:layout_gravity="right" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance ="@style/text_ihm" android:text="@string/name" /> <TextView android:id="@+id/name_edit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance ="@style/text_ihm" android:text="" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:id="@+id/nb_tab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance ="@style/text_ihm" android:text="@string/nb_tab" /> <TextView android:id="@+id/nb_tab_edit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance ="@style/text_ihm" android:text="0" /> </LinearLayout> <!-- android:layout_gravity="start" tells DrawerLayout to treat this as a sliding drawer on the left side for left-to-right languages and on the right side for right-to-left languages. The drawer is given a fixed width in dp and extends the full height of the container. A solid background is used for contrast with the content view. --> <ListView android:id="@+id/right_drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" android:background="#111"/> </LinearLayout> </android.support.v4.widget.DrawerLayout> Modifié 2 septembre 2014 par tlarour Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
tlarour Posté(e) 3 septembre 2014 Auteur Share Posté(e) 3 septembre 2014 personne? tuto, lien, explication, je prends tout Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
chpil Posté(e) 4 septembre 2014 Share Posté(e) 4 septembre 2014 Bonjour, Tu peux déjà te baser sur la doc developer Android, tu y trouveras notamment un tutorial (avec exemple complet) pour le drawer. De même pour le ViewPager. Même si associer ces deux éléments risque de créer des interférences (les 2 se basant sur des swipes) ... 1 Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
tlarour Posté(e) 4 septembre 2014 Auteur Share Posté(e) 4 septembre 2014 Merci, J'ai effectivement des soucis pour gérer les deux éléments mais j'ai trouvé un début de solition avec l'utilisation d'un ViewPagerIndicator plutot que de l'afficher dans l'actionBar http://viewpagerindicator.com/ Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Recommended Posts
Rejoignez la conversation
Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.