私はSupport Library 23.2で追加された新しいBottomSheetDialogを使用していますが、ダイアログのデフォルトの高さを変更したいと思います。最初の高さを制御するbehavior_peekHeight
属性と関連付ける必要があることはわかっていますが、BottomSheetBehavior
に直接アクセスできない場合は、BottomSheetDialog
にどのように設定しますか?もう一つの方法は、BottomSheetDialogFragment
を継承しているBottomSheetDialogのデフォルトの高さを変更するにはどうすればよいですか?
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
</style>
<style name="AppBottomSheetDialogTheme"
parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppModalStyle</item>
</style>
<style name="AppModalStyle"
parent="Widget.Design.BottomSheet.Modal">
<item name="behavior_peekHeight">@dimen/custom_peek_height</item>
</style>
これは機能しませんTheme.AppCompat.Light.NoActionBarを親のレイアウトとして使用する –
behavior_peekHeightは、値が208dpより大きい場合にのみ有効です。何故ですか? –
@AmJay - バージョン23.2.1で修正されるはずです。更新してください! – ianhanniballake