Jump to content

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>

Edited by tlarour
Link to comment
Share on other 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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...