android 怎样获取toolbar上的菜单控件

2025-04-23 19:27:29
推荐回答(1个)
回答1:

Activity的布局文件
先看Android官方Navigation Drawer说明:Creating a Navigation Drawer
根据说明,将 layout/activity_base.xml 设置为以下内容:

android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

android:id="@+id/left_drawer"