1

My layout:

<CoordinatorLayout>

    <FrameLayout />

    <BottomNavigationView />

</CoordinatorLayout>

This bottom navigation has a CoordinatorLayout.Behavior that manages hiding it when the fragment displayed in the FrameLayout is scrolled.

I do not understand how I could prevent the FrameLayout overlapping with the bottom navigation since I cannot place them in another layout because the BottomNavigationView needs to be a direct child for the CoordinatorLayout behavior.

As a workaround, when I set a bottom padding on the FrameLayout, that works, but then the space remains empty when the bottom navigation is hidden, changing it with an animation would be possible but seems like quite some work.

Is there really no way I can align children in a CoordinatorLayout in a way that they don't overlap?

Zackline
  • 804
  • 1
  • 9
  • 28
  • Have you tried this https://stackoverflow.com/questions/42631542/show-hide-bottomnavigationview-on-scroll-in-coordinatorlayout-with-appbarlayout – Quentin Menini Nov 22 '17 at 14:56
  • @QuentinMenini Yes, this is what my behavior for hiding the bottom navigation is based on. However, the CoordinatorLayout acts like a FrameLayout, placing the BottomNavigation at the bottom via gravity, but overlapping the FrameLayout. A workaround would be always hiding the BottomNavigation when scrolled to the bottom of the frame, this way the overlap would not be noticeable. I was hoping for a more solid solution though. – Zackline Nov 22 '17 at 15:38

0 Answers0