Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid's EditText is hidden when the virtual keyboard is shown and a SurfaceView is involved
    primarykey
    data
    text
    <p>I have a simple user interface: an EditText should be located below a SurfaceView. I use a RelativeLayout to arrange these two views. </p> <p>Now, when I tap on the EditText to open the virtual keyboard the SurfaceView slides up but the EditText is hidden and does not show the typed string.</p> <p>To reproduce, use the following layout XML code:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout01" android:layout_height="fill_parent" android:layout_width="fill_parent"&gt; &lt;SurfaceView android:id="@+id/SurfaceView01" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;/SurfaceView&gt; &lt;EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:selectAllOnFocus="true" android:textStyle="normal" android:singleLine="true"&gt; &lt;/EditText&gt; &lt;/RelativeLayout&gt; </code></pre> <p>The main Activity class only needs to show the layout. When I start the program and tap the EditText, the virtual keyboard appears but the EditText field is gone.</p> <p>Maybe the RelativeLayout is causing the problems, but I don't know how to reproduce the same layout with another Layout class.</p> <p>Any suggestions are welcome, I really appreciate your help.</p> <p>Thanks.</p> <p>Edit:</p> <p>Here are two screenshots, one showing the EditText at the bottom without virtual keyboard, one with virtual keyboard but with no EditText. It is interesting to note that the SurfaceView and the EditText actually shift upward, the EditText just disappears. BTW this also happens to a button if it is next to the EditText.</p> <p><a href="http://i46.tinypic.com/fqaz5.png" rel="noreferrer">EditText below a SurfaceView (left); EditText is gone (right)</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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