Android listview和slidingdrawer出现错误
我有这个问题两天了,我找不到任何解决办法Android listview和slidingdrawer出现错误,android,listview,dimensions,slidingdrawer,Android,Listview,Dimensions,Slidingdrawer,我有这个问题两天了,我找不到任何解决办法 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ListV
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/presentation_list"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/presentation_list"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="horizontal" >
<Button
android:id="@+id/handle"
android:layout_width="40dp"
android:layout_height="fill_parent"
android:background="@android:color/darker_gray" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/content_imageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black" />
</LinearLayout>
</SlidingDrawer>
我已经为此寻找了很多次解决方案,但没有一个对我有效
有没有人能给我带来突破?非常感谢 我认为您必须定义
滑动抽屉
内部线性布局
而不是相反。请思考一下……如果您为滑动抽屉内的内容图像视图定义准确的尺寸,会发生什么
从查看您的代码和Android文档来看,这似乎是唯一的区别
可能值得一读,以便更好地理解未指定的及其在度量中的用法
另请参见为控制柄组件指定设置尺寸
关于您定义的布局,您最好指定滑动抽屉以对齐底部,并对齐滑动抽屉上方的列表视图。在一个简短的列表中,您的滑动抽屉将位于布局的一半…在相对布局中为您的android:layou height
指定一个数字(例如600度)。当滑动抽屉布局高度为match\u parent
时,它将跟随布局高度为fill\u parent
的相对布局,这将导致滑动抽屉无限大。不是这样,线性布局代表我的滑动抽屉内容。我的布局现在可以工作了,更新了我的问题以匹配布局。
AndroidRuntime(4722): java.lang.RuntimeException: SlidingDrawer cannot have UNSPECIFIED dimensions