Android:BottomSheetDialog的全屏和最大高度

时间:2016-08-10 10:08:57

标签: android material-design bottom-sheet

当显示`BottomSheetDialog时,有没有办法做ff?

  1. 隐藏状态栏或制作BottomSheetDialog全屏?
  2. 限制BottomSheetDialog的高度,因此它不会与ActionBar
  3. 重叠

    活动

    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        >
      <RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent">
    
         <include android:id="@+id/toolbar"
              layout="@layout/layout_toolbar"/>
         <!-- other UI stuff -->
    </RelativeLayout>
      <ViewStub
          android:id="@+id/view_stub"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom" />
    </android.support.design.widget.CoordinatorLayout>
    

    BottomSheetDialog布局这是在ViewStub中加载的

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        xmlns:tools="http://schemas.android.com/tools"
        android:orientation="vertical"
        app:behavior_peekHeight="100dp"
        android:background="@android:color/transparent">
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/share_via"
            android:layout_margin="@dimen/my_padding"/>
    
        <GridView
            android:id="@+id/grid"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawSelectorOnTop="true"
            android:listSelector="@drawable/grid_selector"
            android:stretchMode="columnWidth"
            tools:listitem="@layout/grid_item_layout" />
    
    </LinearLayout>
    

    扩展BottomSheetDialog Expanded BottomSheetDialog

    Peek Height BottomSheetDialog Peek Height BottomSheetDialog

    Hidden BottomSheetDialog Hidden BottomSheetDialog

0 个答案:

没有答案