我試圖用this教程將滑動抽屜放到我的活動中。我的應用程序適用於Android 2.1-update1(API 7)。當我創建一個XML佈局是這樣的:Android SlidingDrawer
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<SlidingDrawer
android:id="@+id/slidingDrawer"
android:handle="@+id/drawerHandle"
android:content="@+id/contentLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center">
<EditText android:text="" android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="100px"/>
<Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:prompt="@string/strFilter" />
<Button android:text="Filtriraj" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
</LinearLayout>
</SlidingDrawer>
<ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent">
<TableLayout android:layout_width="fill_parent" android:id="@+id/tableLayout1" android:layout_height="fill_parent" android:orientation="horizontal">
<TableRow android:id="@+id/tableRow1" android:layout_height="wrap_content" android:baselineAligned="true" android:layout_gravity="center_horizontal" android:clipChildren="true" android:gravity="center_horizontal" android:layout_width="fill_parent" android:layout_margin="3dip">
<TextView android:clickable="true" android:layout_height="wrap_content" android:text="@string/lblOd" android:id="@+id/textView1" android:layout_gravity="center_horizontal" android:layout_width="fill_parent" android:layout_marginRight="5dip"></TextView>
<TextView android:clickable="true" android:layout_height="wrap_content" android:id="@+id/textView2" android:text="@string/lblDatum" android:layout_gravity="center_horizontal" android:layout_width="fill_parent" android:drawableLeft="@drawable/arrowdown"></TextView>
<TextView android:clickable="true" android:layout_height="wrap_content" android:id="@+id/textView3" android:text="@string/lblTekst" android:layout_gravity="center_horizontal" android:layout_width="fill_parent" android:layout_marginLeft="3dip"></TextView>
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
我得到了一個異常時,切換到「設計視圖」 - 圖形佈局。錯誤是
ClassCastException: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be found: - SlidingDrawer
我的代碼有什麼問題?