remy boys remy boys - 5 months ago 33
Android Question

ActionBar , TabLayout are leaving (unnecessary ) space after become hidden , Gone

am trying to hide and show tabLayout and action bar via some different listeners:

but after hiding them there occupied space is still exists
please see the below images for better understanding :

i have ActionBar + TabLayout
enter image description here

Tab Changed so Action is now hidden but still the space taken by ActionBar exists

enter image description here

SaerchBegins now am hiding the TabLayout but still getting same Behaviour (the Blank Space is still here )

enter image description here

this is how am hiding and them :

//TabLayout

tabLayout.setVisibility(View.GONE);
tabLayout.setVisibility(View.INVISIBLE);


// actinBar

actionBar.hide();


how to fix this ? anyone ? any clue ?

Answer

it turns out the extra unwanted space was just because of :

android:fitsSystemWindows="true"

changing it to false did the job

Comments