scrollView上方的底部工作表

时间:2016-06-13 13:11:07

标签: android android-scrollview bottom-sheet

我想要这种应该在ScrollView上方的底页。

enter image description here

滚动视图中的图像应位于底部工作表的后面。底部工作表应始终在屏幕上,直到单击其上的继续按钮。任何帮助将不胜感激。谢谢!!

2 个答案:

答案 0 :(得分:0)

如果底部工作表/面板始终存在,则无需重叠这些面板,请检查此简化的xml布局示例:

<?xml version="1.0" encoding="utf-8"?>
<!-- This is your root layout element -->
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:android_width="match_parent"
  android:android_height="0dp"
  android:layout_weight="4">

  <ScrollView
    android:android_width="match_parent"
    android:android_height="0dp">
    <!-- Put your inner grid layout here -->
  </ScrollView>


  <!-- this is your bottom panel layout -->
  <!-- you can control the size of your bottom -->
  <!--  pane by playing with the layout weights  -->
  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1">

    <Button
      android:text="Proceed"
      android:background="@drawable/yourSelectorXml"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"/>
  </LinearLayout>

 </LinearLayout>

答案 1 :(得分:-1)

让我们看看代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:android_width="match_parent"
    android:android_height="0dp"
    android:layout_weight="4">

    <ScrollView
        android:android_width="match_parent"
        android:android_height="0dp">
        <!-- Put your inner grid layout here -->
    </ScrollView>

    <!-- put your bottom panel layout here -->

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <Button
            android:text="Proceed"
            android:background="@drawable/yourSelectorXml"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </LinearLayout>
</LinearLayout>