Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How not show white space when hide/show action bar?

I have been searching the answer about this question for two days but I didnt find.

I'm trying to hide the action bar in order to show an image properly, but whenever I hide/show the action bar the activity show a white space at the bottom. I know that it happens because the window resize on hide/show action bar event, also that is a default animation from Android, but I need to change that color (black color) or not show this white space. But how can I do it?

I've tried to set the activity background in black, but it still not working.

E.g. USA Today app do it at the section "Day in pictures"

Please any help is apreciated!

Thanks in advance.

like image 263
AMarones Avatar asked Nov 26 '22 16:11

AMarones


1 Answers

Have you tried setting the action bar to overlay the content area instead of resting on top of it? In your onCreate(), add this at the top just after calling super.onCreate():

getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
like image 115
Karakuri Avatar answered Dec 09 '22 15:12

Karakuri