Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid EditText does not expand to mutiple lines when set android:inputType
    primarykey
    data
    text
    <p>I used a EditText widget to contain contacts. The layout file is as below</p> <pre><code>&lt;EditText android:id="@+id/contact_name_editor" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/add_recipients" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="3dip" android:layout_marginRight="3dip" android:background="@drawable/search_bar_in_new_chat" android:hint="Recipients" android:imeOptions="actionDone" android:paddingLeft="6dip" android:paddingRight="6dip" android:paddingTop="3dip" android:paddingBottom="3dip" android:scrollHorizontally="true" android:maxLines="3" android:textSize="15sp" android:editable="true" android:clickable="true" android:visibility="visible" /&gt; </code></pre> <p>It works fine, the default line is 1 and when many contacts are filled in, it will expand to 3 lines and scroll.<br> Then I changed it to the following(just added a <code>android:inputType="number|text"</code> attribute):</p> <pre><code>&lt;EditText android:id="@+id/contact_name_editor" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/add_recipients" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="3dip" android:layout_marginRight="3dip" android:background="@drawable/search_bar_in_new_chat" android:hint="Recipients" android:imeOptions="actionDone" android:paddingLeft="6dip" android:paddingRight="6dip" android:paddingTop="3dip" android:paddingBottom="3dip" android:scrollHorizontally="true" android:maxLines="3" android:inputType="number|text" android:textSize="15sp" android:editable="true" android:clickable="true" android:visibility="visible" /&gt; </code></pre> <p>Then it failed expanding, just keep single line.</p> <p>Why setting the inputType blocks the <code>EditText</code> expanding?</p>
    singulars
    1. This table or related slice is empty.
    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. 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