我有這個問題2天,我找不到任何解決方案。listview和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" >
<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>
我有這個非常簡單的佈局,listview
和slidingdrawer
,我要過來了listview
。當我打開我的activity
沒有任何信息,它顯示完美,沒有任何例外。
但是當我的listview
中有一個項目時,我的slidingdrawer
給出了一種例外。
AndroidRuntime(4722): java.lang.RuntimeException: SlidingDrawer cannot have UNSPECIFIED dimensions
我搜索了很多次的一個解決方案,但對我來說都不奏效。
有沒有人對我有着輝煌的突破?這是非常讚賞!
我的佈局現在運行,更新我的問題以匹配佈局。 – Robin 2012-08-09 10:40:17