Note that there are some explanatory texts on larger screens.

plurals
  1. POGradient background gets white when closing keyboard (only when list view has items)
    text
    copied!<p>I have a gradient that covers the whole background of my layout. However when I close the software keyboard it takes about 1 second for the gradient to resize to full height. This produces the white background you see in the picture below.</p> <p>I thought of doing something like</p> <pre><code>android:windowSoftInputMode="adjustPan" </code></pre> <p>however this would be bad practice because a big part of the list view would be hidden under the keyboard. The gradient:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:useLevel="false" &gt; &lt;gradient android:startColor="#0d2d70" android:endColor="#007dbc" android:useLevel="false" android:type="linear" android:angle="45" /&gt; &lt;/shape&gt; </code></pre> <p>The layout:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/gradient" android:padding="20dp" &gt; &lt;!-- input field is here --&gt; &lt;ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/input_licence" android:divider="#FFFFFF" android:dividerHeight="1dp" android:padding="5dp" android:scrollbarStyle="outsideOverlay" &gt; &lt;/ListView&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Any ideas how to prevent the white space?</p> <p><img src="https://i.stack.imgur.com/jUkZg.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload