我想要一個滑動抽屜,它顯示在我的視圖底部,但它目前不顯示。我也嘗試使用線性佈局作爲根,滾動視圖的權重爲1,但導致滾動視圖及其內容不顯示。有任何想法嗎?滑動抽屜不顯示
筆者認爲:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
android:id="@+id/scrollLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".AddScheduleItemActivity" >
.
.
.
</LinearLayout>
</ScrollView>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/scrollLayout"
android:content="@+id/content"
android:handle="@+id/handle" >
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Handle" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/hadsfndle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sdf" />
</LinearLayout>
</SlidingDrawer>
感謝, 彌敦道
在我想要的藍色是滾動視圖和內容,綠色是圖片滑塊的手柄。
嘗試了下面的一些其他建議,但仍然無法正常工作。 scrollview的內容顯示正常,但滑塊未顯示。需要更多的建議!謝謝!
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:gravity="bottom"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
.
.
.
</RelativeLayout>
</ScrollView>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="50dip"
android:layout_alignParentBottom="true"
android:layout_below="@+id/scrollLayout"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="vertical" >
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Handle" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/hadsfndle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sdf" />
</LinearLayout>
</SlidingDrawer>
</RelativeLayout>
那麼看來滑動抽屜不再受支持,所以我想我會尋找一個替代:(
能否請你讓我確切地知道你希望你的滑蓋的?在屏幕的底部還是屏幕的頂部?我已經測試過您的佈局,並在底部顯示滑塊,並從下到上打開。 – GrIsHu
我想要在底部。對於我發佈的佈局,您可能會看到滑塊,因爲線性佈局中沒有任何內容。添加一堆元素,直到它們超出屏幕上的空間。此時,滾動視圖將滑塊手柄推離屏幕。 – Nath5