How to wrap text to next line in an Android TextView?

UMAR-MOBITSOLUTIONS picture UMAR-MOBITSOLUTIONS · Nov 11, 2010 · Viewed 76.3k times · Source

I am using following TextView to display some data in it:

<TextView android:id="@+id/notificationText" 
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:textSize="18sp"
        android:inputType="textMultiLine"
        android:maxLines="2"
        android:layout_paddingRight="20dip"
        android:textColor="#ffffff"/>

I want to wrap text to next line. How can I do this?

Answer

Paresh Mayani picture Paresh Mayani · Nov 11, 2010

you must set android:scrollHorizontally="false" in your xml.