prevent undesired line wrapping in TextView prevent undesired line wrapping in TextView android android

prevent undesired line wrapping in TextView


Add the following to your TextView definition:

android:maxLines="1"


The option shown below is deprecated

android:singleLine="true"

Instead use this:

android:maxLines="1"


From TextView Ellipsize (...) not working:

 <TextView android:id="@+id/lName"      android:style="@style/autoscroll" />

And in your style.xml

 <style name="autoscroll">    <item name="android:singleLine">true</item>    <item name="android:ellipsize">marquee</item>    <item name="android:marqueeRepeatLimit">marquee_forever</item>    <item name="android:focusable">true</item>    <item name="android:focusableInTouchMode">true</item>    <item name="android:scrollHorizontally">true</item></style>