Aller au contenu

affichage de deux vues XML


tlarour

Recommended Posts

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é par tlarour
Lien vers le commentaire
Partager sur d’autres sites

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) ...

  • Like 1
Lien vers le commentaire
Partager sur d’autres sites

Rejoignez la conversation

Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

×   Collé en tant que texte enrichi.   Coller en tant que texte brut à la place

  Seulement 75 émoticônes maximum sont autorisées.

×   Votre lien a été automatiquement intégré.   Afficher plutôt comme un lien

×   Votre contenu précédent a été rétabli.   Vider l’éditeur

×   Vous ne pouvez pas directement coller des images. Envoyez-les depuis votre ordinateur ou insérez-les depuis une URL.

×
×
  • Créer...