Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有标题、3 个项目和按钮的单一布局。如果状态为 STATE_COLLAPSED 并且所有视图为 STATE_EXPANDED,我只需要设置标题、1 个项目和按钮。我必须怎么做?
展开时设置 View.Visibile bottomsheet,调用时设置bottomsheetView.GONE。更多的代码会很好。
bottomsheet
使用bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback()并覆盖该onStateChanged方法。
bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback()
onStateChanged
bottomsheetbehavior 的状态有 bottomsheetdialog 的状态方法