It is due to the app:layout_anchor
attribute. You must get rid of the anchor before changing visibility:
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
p.setAnchorId(View.NO_ID);
fab.setLayoutParams(p);
fab.setVisibility(View.GONE);
More Related Contents:
- FloatingActionButton example with Support Library
- How to customize item background and item text color inside NavigationView?
- How to change the new TabLayout indicator color and height
- How to use a TabLayout with Toolbar inside CollapsingToolbarLayout?
- TextInputLayout not showing EditText hint before user focus on it
- Android How to implement Bottom Sheet from Material Design docs
- How I can remove the unnecessary top padding of the Navigation view?
- How to add shadow to the FAB provided with the android support design library?
- Android FAB icon always black with MaterialComponents theme
- Adjust icon size of Floating action button (fab)
- Android Design Support Library expandable Floating Action Button(FAB) menu
- FloatingActionButton with text instead of image
- Disable icon colorStateList in NavigationView
- FAB animation with viewpager/tabslider
- How to change android design support library FAB Button border color?
- CollapsingToolbarLayout setTitle() does not update unless collapsed
- What is the difference between Android Material Design UI and Android UI without material design?
- Put constant text inside EditText which should be non-editable – Android
- Outlined Edit Text from Material Design
- Android “elevation” not showing a shadow
- Android design support library for API 28 (P) not working
- Change EditText hint color when using TextInputLayout
- InflateException with FloatingActionButton from Official Design Library
- Don’t collapse Toolbar when RecyclerView fits the screen
- TabLayout Tab Title text in Lower Case
- how to Customize the Contextual Action Bar using appCompat in material design
- Error when using any Android Design Support Library Elements
- Rounded corners on material button
- Bottom Align Floating Action Button
- Android support v23.1.0 update breaks NavigationView get/find header