2017-08-02 14 views
0

は、私は私のレイアウトXMLを持って、画面のない下の底から来ている:私が言うことができるものから、AndroidのボトムシートがCoordinatorLayout、おおよそ以下のように見える

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/main_content" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent"> 

    <android.support.v4.widget.NestedScrollView 
     xmlns:card_view="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/svDetail" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <LinearLayout 
      android:id="@+id/llSomeDetails" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 
     </LinearLayout> 
    </android.support.v4.widget.NestedScrollView> 

    <android.support.v4.widget.NestedScrollView 
     android:id="@+id/bottomSheetContent" 
     android:layout_width="match_parent" 
     android:layout_height="fill_parent" 
     android:clipToPadding="true" 
     app:behavior_hideable="true" 
     app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> 

    </android.support.v4.widget.NestedScrollView> 
</android.support.design.widget.CoordinatorLayout> 

、bottomSheetContentから来る必要があります画面の下部ではなく、ビューの下部にあります。 llSomeDetailsは内容の良いビットを持っているので、通常は画面から消えます。

答えて

0

このようにそれを試してみてください。

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/main_content" 
android:layout_width="match_parent" 
android:layout_height="fill_parent"> 

<android.support.v4.widget.NestedScrollView 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/svDetail" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <LinearLayout 
     android:id="@+id/llSomeDetails" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 
    </LinearLayout> 
</android.support.v4.widget.NestedScrollView> 

<android.support.v4.widget.NestedScrollView 
    android:id="@+id/bottomSheetContent" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    android:clipToPadding="true" 
    app:behavior_hideable="true" 
    app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> 

</android.support.v4.widget.NestedScrollView> 
<!-- include your bottom sheet here --> 
<include layout="@layout/bottom_sheet" /> 
</android.support.design.widget.CoordinatorLayout> 

ボトムシートが別のレイアウトファイルで作成された後、あなたの主な活動のレイアウト

にインポートする必要があることを覚えておいてください
関連する問題