Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is what I understand of this problem after digging in the code of Android and building some test layouts with an <code>EditText</code>.</p> <p>As <code>ScrollView</code> is defined as</p> <pre><code> public class More ...ScrollView extends FrameLayout { ... } </code></pre> <p>I tried using a <code>FrameLayout</code> as a container for an <code>EditText</code> item. As a result the software keyboard is not triggered.</p> <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;EditText android:id="@+id/editText1" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:inputType="text" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;/FrameLayout&gt; </code></pre> <p>But as written in the question, using a ScrollView triggers the software keyboard (I simplified the xml source).</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;EditText android:id="@+id/editText1" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:inputType="text" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;/ScrollView&gt; </code></pre> <p>So the element that allows the software keyboard to be triggered is in the <code>ScrollView</code> source file.</p> <p>Edit: after having created my own class <code>MyFrameLayout</code> extending FrameLayout and playing with the code, I found that it is something in default scrollview style (<code>R.attr.scrollViewStyle</code>) that is responsible for the keyboard to be shown or not...</p> <p>Edit2: finally the attribute <code>android:scrollbars</code> allows the keyboard to be automatically triggered at startup if present...</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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