Home > Mobile >  BottomSheetBehavior when used with a SurfaceView will be overwritten
BottomSheetBehavior when used with a SurfaceView will be overwritten

Time:09-17

As shown in the topic, on the first code
 
XMLNS: app="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="MainActivity" & gt;

Android: layout_width="match_parent"
Android: layout_height="match_parent"/& gt;

Android: layout_width="wrap_content"
Android: layout_height="wrap_content"
Android: background="# d6d6d6" & gt;

The android: id="@ + id/BTN"
Android: layout_width="wrap_content"
Android: layout_height="wrap_content"
Android: text="button"/& gt;


The android: id="@ + id/scroll_bottom"
Android: layout_width="match_parent"
Android: layout_height="match_parent"
Android: background="# FFFFFF"
App: behavior_hideable="true"
App: behavior_peekHeight="200 dp"
App: layout_behavior="@ string/bottom_sheet_behavior" & gt;

The android: id="@ + id/ll_bottom"
Android: layout_width="match_parent"
Android: layout_height="wrap_content"
Android: orientation="vertical" & gt;

Android: layout_width="wrap_content"
Android: layout_height="wrap_content"
Android: text="123"/& gt;

Android: layout_width="wrap_content"
Android: layout_height="wrap_content"
Android: text="456"/& gt;




The activity set in the
 
NestedScrollView scroll_bottom=the findViewById (R.i d.s croll_bottom);
BottomSheetBehavior BottomSheetBehavior=BottomSheetBehavior. The from (scroll_bottom);
//the default hidden
BottomSheetBehavior. SetState (bottomSheetBehavior. STATE_HIDDEN);

The Button BTN=the findViewById (R.i db tn);
BTN. SetOnClickListener (new View. An OnClickListener () {
@ Override
Public void onClick (View View) {
If (bottomSheetBehavior getState ()==bottomSheetBehavior. STATE_HIDDEN) {
BottomSheetBehavior. SetState (bottomSheetBehavior. STATE_COLLAPSED);
}
}
});

Click on the button function is BottomSheetBehavior, if you don't use SurfaceView that, according to the normal if using the SurfaceView layout, then click on the button BottomSheetBehavior obscured,, every brother please give directions

CodePudding user response:

The bringToFront () method can make the control display in the upper,

CodePudding user response:

reference 1st floor qq_1113502097 response:
the bringToFront () method can make the control display in the upper,

This method tried is not working
  • Related