I set "android:uiOptions="splitActionBarWhenNarrow" in AndroidManifest.xml. Therefore, if there is no enough room for the device, the action bar will be split into two parts.
Sometime, I want to hide the action bar by calling getActionBar().hide(). But it will leave an ugly white space in the bottom. How can I get rid of it?
I tried to call getActivity().getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY), but it would block my webview content.
Just a simple work, simply use OverLay. use this in your style
<style name="AppTheme" parent="@style/Theme.AppCompat">
<item name="android:windowNoTitle">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowActionBarOverlay">true</item>
</style>
or if you want to do it by programmatically, just past it before your setContentView() function
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
and give some transparency, so it won't hide the web content. just read the documentation for the style
http://developer.android.com/training/basics/actionbar/overlaying.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With