沒有行動酒吧,我創建了抽屜菜單: drawer menu. 正如你所看到的,我設法完美展現抽屜,但是當我包括activity_main.xml中它沒有得到的數據(變量&佔位符)抽屜導航對於現有項目
我main_activity.xml:how it looks, TextView should be numbers and placeholder not getting any data 所以... drawer_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="end"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include
layout="@layout/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_container"
/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/drawer_menu" />
</android.support.v4.widget.DrawerLayout>
我需要顯示的數據,並仍採用抽屜......這可能嗎?如果你需要更多的信息,只是問,我會提供
編輯:我需要將信息從MainActivity.class(連接到activity_main.xml)傳遞到Drawer_layout.class? (連接到drawer_layout.xml)