导航抽屉实现出错

时间:2013-11-05 04:56:51

标签: android navigation-drawer

这是我的xml文件

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

<!-- As the main content view, the view below consumes the entire
     space available using match_parent in both dimensions. -->
<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<!-- android:layout_gravity="start" tells DrawerLayout to treat
     this as a sliding drawer on the left side for left-to-right
     languages and on the right side for right-to-left languages.
     The drawer is given a fixed width in dp and extends the full height of
     the container. A solid background is used for contrast
     with the content view. -->
<ListView
    android:id="@+id/listView1"
    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:background="#111"/>
  </android.support.v4.widget.DrawerLayout>

当尝试运行项目时崩溃..错误是

11-05 04:22:16.296: E/AndroidRuntime(1252): FATAL EXCEPTION: main
11-05 04:22:16.296: E/AndroidRuntime(1252): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.exaple.customadapter/com.exaple.customadapter.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v4.widget.DrawerLayout

为什么会出现此错误?如何解决这个问题。

0 个答案:

没有答案