dsynkd
dsynkd

Reputation: 2145

Action bar removal leaves blank space

I'm an android beginner. I did not want my app to have an action bar, so I disabled it.

However, other views are displayed after a blank padding, which is where the action bar previously was. Like

enter image description here

How can I have this space removed? I have tried:

Upvotes: 3

Views: 2154

Answers (1)

dastan
dastan

Reputation: 930

Add this code in style.xml

 <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:actionBarSize">0dp</item>
</style>

and use this code in Activity theme in manifest.

<activity 
       android:name=".MainActivity"
       android:theme="@style/AppTheme.NoActionBar">
</activity>

Upvotes: 5

Related Questions