私はtoolbar
のカスタムとBottomSheet
の両方の永続性を持つアプリケーションレイアウトを持っています。どちらもCoordinatorLayout
の中にあります。下の永続的なボトムシート
ボタンをクリックすると、BottomSheet
が表示されます。現在、シートはフルスクリーンで表示され、toolbar
をオーバーレイしています。アプリのテーマをTheme.AppCompat.Light.DarkActionBar
に設定すると、BottomSheet
はActionBar
以下になりますが、バーをカスタマイズすることはできません。
persententの高さを制限する方法はありますかBottomSheet
フルスクリーン - ActionBar
高さですか?
これはここactivity_main.xml
<android.support.design.widget.CoordinatorLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:attrs="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.test.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
app:elevation="20dp"
android:elevation="20dp"
android:layout_height="?attr/actionBarSize">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
app:elevation="20dp"
android:elevation="20dp"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
</android.support.design.widget.AppBarLayout>
</LinearLayout>
<include layout="@layout/bottom_sheet_additem"/>
</CoordinatorLayout>
に自分のコードである左側のsheet_bottom.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottomSheetLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
android:fitsSystemWindows="true"
app:layout_behavior="@string/bottom_sheet_behavior">
<TextView
android:id="@+id/bottomsheet_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Lorem Ipsum Dolor..."
android:textColor="#FFFFFF" />
</RelativeLayout>
のコード画像が
Toolbar
下に停止BottomSheet
を示している - です現在のコードでは動作しません。現在、それは右の写真のように見えます。
のあなたはスクリーンショットをアップロードすることができますか? –
質問に追加されたスクリーンショット - EDIT – nor0x
レイアウトの高さを下からツールバーに設定し、下のシートを子にして親の高さ(新しいレイアウト)に合わせて設定してみましょう。 –