禁止用户在BottomSheet上拖动
我试图禁止用户拖动BottomSheet。我要禁用的原因有两点。1.防止ListView向下滚动。2.我不希望用户通过拖动来撤消操作,而是使用上的按钮BottomSheetView。这就是我所做的 bottomSheetBehavior = BottomSheetBehavior.from(bottomAnc); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { if (newState == BottomSheetBehavior.STATE_EXPANDED) { //Log.e("BottomSheet", "Expanded"); } else if (newState == BottomSheetBehavior.STATE_COLLAPSED) { //Log.e("BottomSheet", "Collapsed"); } } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { // React to dragging events bottomSheet.setOnTouchListener(new View.OnTouchListener() …