Sushant Bhatnagar
Sushant Bhatnagar

Reputation: 3784

Textview show partial text in android

I have a textview in which I must load a message. I want to set number of variable is display in textview and after that left message replace with add three dots (...). How can I detect set number of variable is display and after that display three dots(..)

My code for textview is

<TextView
        a:id="@+id/tv_message"           
        a:layout_width="wrap_content"
        a:layout_height="wrap_content"          
        a:textColor="@android:color/black"
        />

Upvotes: 0

Views: 1060

Answers (1)

Prasham
Prasham

Reputation: 6686

In text view you should work with ellipsize property in xml.... Though you need some workaround in Java to make it variable......

Upvotes: 1

Related Questions