Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid layout with navigation drawer
    primarykey
    data
    text
    <p>I am new to android, and developing a practice app using navigation drawer. I want to make the main view to be a pager with 3 tabs, and a navigation drawer could show up when user slide from left to right.</p> <p>Here is my <b>Main.xml</b> code:</p> <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/main_layout" tools:context=".ExampleMain" &gt; &lt;!-- Main Content place holder --&gt; &lt;FrameLayout android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"/&gt; &lt;!-- Left Drawer main style --&gt; &lt;ListView style="@style/HighlightColor" android:id="@+id/left_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" /&gt; &lt;/android.support.v4.widget.DrawerLayout&gt; </code></pre> <p>In which the <code>&lt;Framelayout&gt;</code> should contain my actual main view defined in another xml <b>Main_Content.xml</b></p> <pre><code>&lt;andriod.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main_content_pager" android:layout_width="match_parent" android:layout_height="match_parent"/&gt; </code></pre> <p>I am not sure how I can put the <code>Viewpager</code> in <b>Main_Content.xml</b> to the <code>&lt;FrameLayout&gt;</code> section in <b>Main.xml</b>. Please provide some example code or some pointer. Thank you</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload