没有行动酒吧,我创建了抽屉菜单: 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)