Skip to content Skip to sidebar Skip to footer

Hiding Actionbar Left Blank Space On Top

I want to hide the ActionBar in one of my fragments but when i call ((MainActivity) getActivity()).getActionBar().hide(); on the fragment I get something like this how to remove

Solution 1:

You should structure your activity so that it overlays the actionbar: here is an example of a theme you might use for it:

<resources><!-- the theme applied to the application or activity --><stylename="CustomActionBarTheme"parent="@android:style/Theme.Holo"><itemname="android:windowActionBarOverlay">true</item></style></resources>

More info about overlaying the Actionbar. also if you aren't planning to always hide the Actionbar, you might need to structure your layouts to account for it while it is visible. Please refer to this question on how to do that. You might also consider refactoring your fragment to be a separate activity and just starting it in the full screen mode right away, by using the "NoTitlebarTheme" with that activity.

Solution 2:

I had the same problem, my problem was to include fitsSystemWindows tag in xml

Solution 3:

Solution 4:

using this line only in that activity android:theme="@android:style/Theme.Black.NoTitleBar" in manifest file

add the getActionBar().hide(); in activity class where your fragments called and use some other fragments in getActionBar().show();.

Post a Comment for "Hiding Actionbar Left Blank Space On Top"