私はアンドロイドが初めてで、ナビゲーションドロワーを使用して練習用アプリを開発しています。メイン ビューを 3 つのタブを持つページャーにしたいのですが、ユーザーが左から右にスライドすると、ナビゲーション ドロワーが表示される可能性があります。
ここに私のMain.xmlコードがあります:
<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" >
<!--
Main Content place holder
-->
<FrameLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!--
Left Drawer main style
-->
<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"
/>
</android.support.v4.widget.DrawerLayout>
別のxml Main_Content.xml<Framelayout>
で定義された実際のメインビューを含める必要があります
<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"/>
Main_Content.xmlViewpager
をMain.xmlの<FrameLayout>
セクションに配置する方法がわかりません。サンプルコードまたはポインターを提供してください。ありがとうございました