相关疑难解决方法(0)

将BottomSheetDialogFragment的状态设置为展开

如何使用Android支持设计库(v23.2.1)将片段的状态设置为扩展BottomSheetDialogFragment为扩展BottomSheetBehavior#setState(STATE_EXPANDED)

https://code.google.com/p/android/issues/detail?id=202396说:

底部工作表首先设置为STATE_COLLAPSED.如果要展开它,请调用BottomSheetBehavior#setState(STATE_EXPANDED).请注意,您无法在视图布局之前调用该方法.

建议的做法需要将第一膨胀的观点,但我不知道我怎么会设置BottomSheetBehaviour到片段(BottomSheetDialogFragment).

View bottomSheet = coordinatorLayout.findViewById(R.id.bottom_sheet);  
BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);  
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-support-library android-support-design

66
推荐指数
12
解决办法
5万
查看次数