How to make a hint in Android EditText?

My click on EditText does not wrap. The hint is not very useful if the last part is disabled. I am very careful about limiting / forcing the size of my EditText window so that it looks decent, regardless of screen size.

This is what the corresponding xml looks like:

<EditText android:id="@+id/ET1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:hint="@string/Hint1" android:lines="3"> </EditText> 

I already set android:lines="3" to fix the problem, but this is not enough. To maximize compatibility with various screen sizes, I would prefer the OS to wrap me up by introducing line breaks and hard line returns. There are other things in the view that also force me not to set the field width manually in order to promote good breaks.

+6
android android-edittext
source share
1 answer

Did you use an old version of the SDK?

I checked that the following hint wraps 3 lines without any problems in the Android 1.5 cache:

  <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="18px" android:gravity="left" android:hint="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse egestas ullamcorper facilisis." /> 
+4
source share

All Articles