tags:

views:

1592

answers:

1

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.

+1  A: 

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." />
Mike
Works perfectly here as well with 1.6
znq