我一直在搞乱 android,而且我已经使用DrawerLayout
Android Support Library v4 构建了用户界面。
我的大学老师强迫我们使用 API Level 10 来为这门学科构建我们的应用程序,所以这就是我正在做的事情。
我正在尝试构建一个内部有 ListView 的 SlidingDrawer,但我找不到正确的方法。以下代码导致两个错误
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/details"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<SlidingDrawer
android:id="@+id/slidingDrawerShowMore"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:topOffset="132dip"
android:handle="@+id/handle"
android:content="@+id/handle">
<ImageView
android:id="@id/handle"
android:layout_width="88dip"
android:layout_height="44dip" />
</SlidingDrawer>
错误信息:
Exception raised during rendering: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
和
Exception raised during rendering: The content attribute is must refer to an existing child.
(这个是在我将抽屉的内容值更改为@+id/content 后引发的)
这是我期待达到的结果。
关于如何解决它的任何想法?
我有这个 UI 在 API 17 上完美运行,在 DrawerLayout 上的 ListView 上有一个自定义 ListAdapter(来自 android.support.v4.widget.DrawerLayout),但它不适用于较低的 API 级别。