Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove ellipsized property of TextView from code?

Tags:

I set my textView to be ellipsezed in xml. Now on click I want it to expend and become not ellipsized.

like image 771
TpoM6oH Avatar asked Jan 09 '13 15:01

TpoM6oH


People also ask

How do I know if TextView Ellipsized?

null){ int lines = l. getLineCount(); if ( lines > 0) if ( l. getEllipsisCount(lines-1) > 0) Log. d(TAG, "Text is ellipsized"); } } });

What is the use of ellipsize in Android?

Android Ellipsize Android TextView ellipsize property Causes words in the text that are longer than the view's width to be ellipsized ( means to shorten text using an ellipsis, i.e. three dots …) instead of broken in the middle to fit it inside the given view.

Can we change the text in TextView?

TextView tv1 = (TextView)findViewById(R. id. textView1); tv1. setText("Hello"); setContentView(tv1);

How do you get 3 dots at the end of a TextView text?

You are applying to your TextView a compound Drawable on the right.. to make the three dots appear in this scenario, you have to apply a android:drawablePadding="{something}dp" attribute to the TextView as well. Hope it helps!


1 Answers

Use setEllipsize() to change the ellipsize behavior of a TextView. For example, to turn off ellipsize use this:

myTextView.setEllipsize(null); 
like image 147
Veger Avatar answered Oct 20 '22 03:10

Veger