0

I'm trying to add "Read more" to a the end of a textView if the text is more than two lines long, but I'm having a hard time doing so. My TextView looks like the following:

<TextView
        android:id="@+id/reviewText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.5"
        android:layout_marginLeft="1dp"
        android:text=""
        android:maxLines="2"
        android:ems="3"
        android:ellipsize="end"
        android:textColor="#FFFFFF" />

So to clarify, right now I get three dots because of the ellipsize but I really want it to write "Read more".

Incidentally, my software is supporting API level 14+.

halfer
  • 19,824
  • 17
  • 99
  • 186
Nikolaj Simonsen
  • 1,650
  • 3
  • 18
  • 34
  • I would go with two TextViews. The "Read more" would be hidden (View.GONE) unless the ellipsize is triggered. See http://stackoverflow.com/a/7259136/2832027 – TTransmit Mar 16 '15 at 15:14

1 Answers1

0

Try to add following two lines:

abdroid:focusable="true"
android:focusableInTouchMode="true"

to your TextView

Xcihnegn
  • 11,579
  • 10
  • 33
  • 33