Skip to content Skip to sidebar Skip to footer

Layout Height Appcompat Not Full Screen

What's wrong with AppCompat? My application does not use AppCompat and there are no problems with XML Layout But after I use AppCompat why is the XML Layout not full on the screen?

Solution 1:

Add this theme to your activity

in style.xml

<stylename="AppTheme"parent="@style/Theme.AppCompat.Light.NoActionBar"><itemname="android:windowNoTitle">true</item><itemname="android:windowActionBar">false</item><itemname="android:windowFullscreen">true</item><itemname="android:windowContentOverlay">@null</item></style>

and define this style to your activity in AndroidManifest :

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

Using this will remove the extra space coming for toolbar by default.

Solution 2:

You can achieve fullscreen mode when you use AppCompact like this

Add this to your style file

<stylename="Theme.AppCompat.Light.NoActionBar.FullScreen"parent="@style/Theme.AppCompat.Light.NoActionBar"><itemname="android:windowNoTitle">true</item><itemname="android:windowActionBar">false</item><itemname="android:windowFullscreen">true</item><itemname="android:windowContentOverlay">@null</item></style>

And in your manifest file add this to your Activity tag

android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"

Post a Comment for "Layout Height Appcompat Not Full Screen"