My EditText
hint is not wrapping. A hint isn't very useful if the last part is cut off. I am very cautious about restricting/forcing the dimensions my EditText
box to ensure it looks decent regardless of screen dimensions.
Here's what the relevant 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've already set android:lines="3"
to mitigate the issue, but it isn't enough. In order to maximize compatibility with various screen dimensions I would prefer OS wrapping over me putting in line breaks and hard returns in the string. There are other things happening in the view which also compel me to not manually set the width of the box to promote good breaks.
Perhaps you were using an old version of the SDK?
I've verified that the following hint wraps to 3 lines without any problem in Android 1.5 cupcake:
<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." />
Add this to the EditText
android:inputType="textMultiLine"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With