我已经对这个主题进行了多次搜索。 我已经完成了以下操作:
- 通过SDK管理器确保支持库已经更新到最新版本。
- 进入构建路径和顺序和导出选项卡,确保依赖项已经被勾选。
- 清理了我的项目并重新启动adt。
- 右键单击项目 -> Android工具 -> 添加支持库。
我已经在另一个项目中使用了支持库,并且它工作得很好,但是我没有使用drawerlayout。 下面是我在活动类中调用的xml文件。 当它调用 setContentView(R.layout.main_sliding_layout);
时会出现此错误。
<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">
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@color/list_divider"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector"
android:background="@color/list_background"/>
</android.support.v4.widget.DrawerLayout>