set ellipsize programmatically android code example

Example 1: android ellipsize attribute

<TextView
       ....
       android:text="Hi I am Amiyo,you can see how to ellipse works."
       android:ellipsize = "end"  
   />

Example 2: ellipsize in android

Example :

<TextView
       ....
       android:text="aaabbbccc"
       android:singleLine = "true"
       android:ellipsize = "end"  
   />

Say original value pf text view is aaabbbccc and its fitting inside the view

start's output will be : ...bccc

end's output will be : aaab...

middle's output will be : aa...cc

marquee's output will be : aaabbbccc auto sliding from right to left

Tags:

Html Example