0

So:

  1. Activity has NavigationView with action bar.
  2. There are 2 fragments - #1 and #2.
  3. In fragment #2 I need to hide action bar.

Ok, successfully did it with

getSupportActionBar.hide()

But when I return to previous fragment and call

getSupportActionBar.show()

content of fragment #1 is moved down on the height of my actionbar.

I've tried to call .show() method onPause() of fragment #2, onResume() of fragment #1, onCreateView() of fragment #1 (before inflating a view) - no result, half of my floatingActionButton is moved below the screen.

OnCreateView() is called in fragment #1 after dismissing fragment #2, but it seems that view is not redrawing. Any ideas how can I solve this?

Goltsev Eugene
  • 3,325
  • 6
  • 25
  • 48
  • Ok, some temporary solution is to call fab.requestLayout() in postDelayed (in 1 ms). But this is so ugly, imo. – Goltsev Eugene Mar 25 '16 at 16:03
  • Sure, one more option is to handle pressing back button and create every time a new instance of fragment instead of popping them from backstack. But I also don't like this too much. – Goltsev Eugene Mar 25 '16 at 20:10

0 Answers0