Android single line TextView without the dots

28,285

Solution 1

<TextView
    android:id="@+id/text_ivew"
    style="@style/Text.Title"
    singleLine="false"
    android:ellipsize="end"
    android:lines="1"
    android:text="text"></TextView>

Solution 2

You should just be able to set the android:ellipsize property to false on your TextView in xml.

Share:
28,285

Related videos on Youtube

700 Software
Author by

700 Software

Join 700.social ! A happy medium between Facebook and Gab. :) The name is too long but the domain looks good. Also, Software Development / Consulting (423) 802-8971 700software.com old username: George Bailey (but now I use my real name) http://www.google.com/images?q=George+Bailey

Updated on July 05, 2022

Comments

  • 700 Software
    700 Software almost 2 years

    Is it possible to have a single line TextView that cuts off at the nearest pixel and does not add three dots?

  • max4ever
    max4ever about 13 years
    according to Eclipse's documentation singleLine is "* Deprecated: This attribute is deprecated and is replaced by the textMultiLine flag in the inputType attribute. Use caution when altering existing layouts, as the default value...." i used it without and works fine on android 2.1 :)
  • Sourabh
    Sourabh about 9 years
    inputType on TextView? Isn't that or EditText?
  • Jose Manuel Abarca Rodríguez
    Jose Manuel Abarca Rodríguez about 9 years
    Didn't work with me, text still shows ellipsis (left cell pushes right cell to the right so text in right cell shows ellipses).
  • Kai Wang
    Kai Wang over 8 years
    or android:ellipsize="none" in XML.
  • Kai Wang
    Kai Wang over 8 years
    setting android:ellipsize="none" in XML is enough.

Related