android - Cannot get the EditText to have multiple lines -


i'm trying have multiple lines in edittext. have tried many solutions working none of them seem work. have right this:

<edittext         android:id="@+id/uf_aboutme_box"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:gravity="top|start"         android:hint="@string/tellusaboutyourself"         android:inputtype="textmultiline"         android:lines="8"         android:maxlines="10"         android:minlines="6"         android:scrollbars="vertical"/> 

although, above code renders correctly in preview, when test on real phone becomes single line! can tell me what's wrong code above?

edit:

the parent layout is:

 <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"               android:layout_width="match_parent"               android:layout_height="wrap_content"               android:orientation="vertical"> 

edit 2:

this entire layout file:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"               android:layout_width="match_parent"               android:layout_height="wrap_content"               android:orientation="vertical">      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="horizontal">          <textview             android:id="@+id/uf_firstname_label"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_weight="1"             android:text="@string/firstnamewithstar"             android:textcolor="@color/orange_dark"             android:textsize="@dimen/font_normal"/>           <textview             android:id="@+id/uf_lastname_label"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_weight="1"             android:text="@string/lastnamewithstar"             android:textcolor="@color/orange_dark"             android:textsize="@dimen/font_normal"/>     </linearlayout>      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="horizontal">          <edittext             android:id="@+id/uf_firstname_box"             android:layout_width="0dp"             android:layout_height="@dimen/editbox_height"             android:layout_marginleft="1dp"             android:layout_marginstart="1dp"             android:layout_weight="1"             android:inputtype="textpersonname"             android:padding="5dp"/>          <edittext             android:id="@+id/uf_lastname_box"             android:layout_width="0dp"             android:layout_height="@dimen/editbox_height"             android:layout_marginleft="2dp"             android:layout_marginstart="2dp"             android:layout_weight="1"             android:inputtype="textpersonname"             android:padding="5dp"/>     </linearlayout>      <!-- email -->      <textview         android:id="@+id/uf_email_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="10dp"         android:text="@string/emailwithstar"         android:textcolor="@color/orange_dark"         android:textsize="@dimen/font_normal"/>      <edittext         android:id="@+id/uf_email_box"         android:layout_width="match_parent"         android:layout_height="@dimen/editbox_height"         android:layout_margintop="5dp"         android:hint="@string/emailhint"         android:inputtype="textemailaddress"         android:padding="5dp"/>      <textview         android:id="@+id/uf_emailnote_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="2dp"         android:text="@string/emailnote"         android:textcolor="@color/black_light"         android:textsize="@dimen/font_small"/>      <!-- password -->      <textview         android:id="@+id/uf_password_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="10dp"         android:text="@string/passwordwithstar"         android:textcolor="@color/orange_dark"         android:textsize="@dimen/font_normal"/>      <edittext         android:id="@+id/uf_password_box"         android:layout_width="match_parent"         android:layout_height="@dimen/editbox_height"         android:layout_margintop="5dp"         android:inputtype="textpassword"         android:padding="5dp"/>      <!-- mobile phone -->      <textview         android:id="@+id/uf_mobile_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="10dp"         android:text="@string/mobilewithstar"         android:textcolor="@color/orange_dark"         android:textsize="@dimen/font_normal"/>      <linearlayout         android:layout_width="match_parent"         android:layout_height="@dimen/editbox_height"         android:layout_margintop="5dp"         android:orientation="horizontal">          <spinner             android:id="@+id/uf_countriesforphone_spinner"             android:layout_width="0dp"             android:layout_height="match_parent"             android:layout_weight="1"             />          <edittext             android:id="@+id/uf_phone_box"             android:layout_width="0dp"             android:layout_height="match_parent"             android:layout_marginleft="2dp"             android:layout_marginstart="2dp"             android:layout_weight="0.75"             android:inputtype="phone"             android:padding="5dp"/>     </linearlayout>      <!-- current city -->      <textview         android:id="@+id/uf_city_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="10dp"         android:text="@string/starredcity"         android:textcolor="@color/orange_dark"         android:textsize="@dimen/font_normal"/>      <spinner         android:id="@+id/uf_city_box"         android:layout_width="match_parent"         android:layout_height="@dimen/editbox_height"         android:layout_margintop="5dp"         android:padding="5dp"/>       <!-- nationality -->      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_margintop="15dp"         android:orientation="horizontal">          <textview             android:id="@+id/uf_nationality_label"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_weight="1"             android:text="@string/nationality"             android:textcolor="@color/orange_dark"             android:textsize="@dimen/font_normal"/>          <textview             android:id="@+id/uf_birthday_label"             android:layout_width="0dp"             android:layout_height="wrap_content"             android:layout_marginleft="2dp"             android:layout_marginstart="2dp"             android:layout_weight="1"             android:text="@string/dateofbirth"             android:textcolor="@color/orange_dark"             android:textsize="@dimen/font_normal"/>     </linearlayout>      <linearlayout         android:layout_width="match_parent"         android:layout_height="@dimen/editbox_height"         android:layout_margintop="5dp"         android:orientation="horizontal">          <spinner             android:id="@+id/uf_countriesfornationality_spinner"             android:layout_width="0dp"             android:layout_height="match_parent"             android:layout_weight="1"             />          <textview             android:id="@+id/uf_birthday_box"             android:layout_width="0dp"             android:layout_height="match_parent"             android:layout_marginleft="2dp"             android:layout_marginstart="2dp"             android:layout_weight="1"             android:drawableend="@drawable/ic_event_available_grey600_18dp"             android:drawableright="@drawable/ic_event_available_grey600_18dp"             android:gravity="center_vertical"             android:hint="@string/selectbrackets"             android:padding="5dp"             android:textsize="@dimen/font_normal"/>     </linearlayout>      <textview         android:id="@+id/uf_gender_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="10dp"         android:text="@string/gender"         android:textcolor="@color/orange_dark"         android:textsize="@dimen/font_normal"/>      <radiogroup         android:id="@+id/uf_gender_radiogroup"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="5dp"         android:orientation="horizontal">          <radiobutton             android:id="@+id/uf_male_radiobutton"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="@string/male"/>          <radiobutton             android:id="@+id/uf_female_radiobutton"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="@string/female"/>     </radiogroup>      <!-- me -->      <textview         android:id="@+id/uf_aboutme_label"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="10dp"         android:text="@string/aboutme"         android:textcolor="@color/orange_dark"         android:textsize="@dimen/font_normal"/>       <edittext         android:id="@+id/uf_aboutme_box"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:gravity="top|start"         android:hint="@string/tellusaboutyourself"         android:inputtype="textmultiline"         android:lines="8"         android:maxlines="10"         android:minlines="6"         android:scrollbars="vertical"/>  </linearlayout> 

try android:singleline="false" :

<edittext     android:id="@+id/uf_aboutme_box"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:gravity="top|start"     android:hint="@string/tellusaboutyourself"     android:inputtype="textmultiline"     android:lines="8"     android:maxlines="10"     android:minlines="6"     android:scrollbars="vertical"     android:singleline="false" /> 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -