当我运行的应用程序,然后单击工具栏上的图标,我得到的错误是“重力LEFT没有发现抽屉视图”重力没有发现抽屉图左侧
这是我的xml文件
主.XML
<android.support.v4.widget.DrawerLayout 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"
android:fitsSystemWindows="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<android.support.v7.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" />
<android.support.v7.widget.RecyclerView
android:id="@+id/book_list_rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
<ListView
android:id="@+id/ListView1"
android:layout_width="241dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#333"
android:choiceMode="singleChoice"
android:divider="#666"
android:dividerHeight="1dp"
android:paddingLeft="15sp"
android:paddingRight="15sp" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
此标识的活动的java文件的代码片段 活动文件
Toolbar mToolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
// drawer
setSupportActionBar(mToolbar);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
mToolbar, R.string.app_name, R.string.app_name);
mDrawerLayout.setDrawerListener(mDrawerToggle);
U可以这样http://stackoverflow.com/questions/30706552/没有更多的允许打开抽屉布局从右侧在导航抽屉/ 30738746#30738746 谢谢:) – ssPerman01 2015-06-09 17:25:29
可能重复[Android DrawerLayout - 没有抽屉视图与重力找到](http://stackoverflow.com/questions/27350136/android-drawerlayout-no-drawer-view-found-with重力) – 2Dee 2015-07-22 22:40:21