9

下hindingに過ぎません下のシートはの私のActionBarと私のタブの下に行く。 ツールバーにどのように表示させることができますか?私のメニューは次のように構成されていますアンドロイドBottomSheet:私はこれは非常に良い作品<a href="https://www.google.com/design/spec/components/bottom-sheets.html#bottom-sheets-behavior" rel="noreferrer">design guidelines</a></p> <p>で提案されているようにボトムシートがフル画面に拡大持つようにサポートライブラリ23.2.0から新しいボトムシートを使用しようとしたツールバー

<android.support.design.widget.AppBarLayout 
     android:id="@+id/appbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingTop="@dimen/appbar_padding_top"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app:layout_scrollFlags="scroll|snap|enterAlways" 
      app:popupTheme="@style/AppTheme.PopupOverlay"/> 

     <android.support.design.widget.TabLayout 
      android:id="@+id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"/> 

    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"/> 

    <include 
     android:id="@+id/playerLayout" 
     layout="@layout/player_main" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:behavior_peekHeight="?attr/actionBarSize" 
     app:layout_behavior="@string/bottom_sheet_behavior" 
     app:model="@{model}"/> 

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

enter image description here

+1

はあなたが行動を持っているなどがレイアウトに 'fitSystemWindows'を試してみましたが、あることを

注意? –

答えて

35

AppBarLayout4dpのデフォルトの標高(寸法リソース値design_appbar_elevation)を持っています。

CoordinatorLayoutは、デフォルトではFrameLayoutのように、API 21以上のデバイスでは高さが低くなる前に要素をレイアウトします。

レイアウトにandroid:elevation="@dimen/design_appbar_elevation"を追加してみてください。モーダルボトムシートの上昇が@dimen/design_bottom_sheet_modal_elevation == 16dp

+1

私はそれを仕事にしました、ありがとう!編集してください:標高は、含まれているレイアウトのルートに追加する必要があります。 タグ内にはありません! –

+0

@ianhanniballakeロリポップ前のデバイスでボトムシートが動作しません。 – sector11

+0

Lollipop前のデバイスと互換性を持たせるために、下のシートが展開されているときにアプリケーションバーを非表示にすることはできませんか? – chubbsondubs

関連する問題

 関連する問題