Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of white strip at the top of the screen with adjustResize

While the keyboard is open a white strip appears at the top of the screen, and it persists regardless of a keyboard state change.

If I a use adjustPan then it works, however, I want to use adjustResize only.

Here is an image of the problem:


My activity declaration in AndroidManifest.xml

<activity
    android:name=".MainActivity"
    android:screenOrientation="portrait"
    android:theme="@style/MyTheme"
    android:windowSoftInputMode="adjustResize"/>

<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:windowDrawsSystemBarBackgrounds" 
          tools:targetApi="lollipop">false</item>
</style>
like image 627
Hits Avatar asked Aug 20 '16 08:08

Hits


1 Answers

There's a technique called Immersive Full-Screen Mode available in KitKat. I think it is now a preferred way to implement a fullscreen Activity.

This is an example from the docs.

like image 138
Gaurav Sarma Avatar answered Nov 11 '22 10:11

Gaurav Sarma