Advertisement

TrimwebsolutionsTrimwebsolutions

Problem and Solutions

How to use Coordinatorlayout with Linearlayout in android studio ?

By M.K. Verma · 4 May 2022

How to use Coordinatorlayout with Linearlayout in android studio ?

I found a simple trick to solve the problem. Inside FragmentContainerView I'm showing a specific fragment and there is NestedScrollView inside the fragment.

I gave these attributes to the NestedScrollView

android:clipToPadding="false"
android:paddingBottom="Should be the same height of BottomNavigationView"

Now the content inside FragmentContainerView will be top of BottomNavigationView and never will touch BottomNavigationView.

The disadvantages of this way

  • It will leave extra space in the bottom but mostly BottomNavigationView will cover it
  • If you give background color for NestedScrollView, The color will touch BottomNavigationView

But at least it is working as I want.