In Android, the maximum length of TextView is set, and the ellipsis is displayed. androidtextview

Source: Internet
Author: User

In Android, the maximum length of TextView is set, and the ellipsis is displayed. androidtextview

Today, I encountered a problem in the project. The title bar on the top of a page shows the company name. However, the company name is too long to be displayed, which affects the appearance. For this reason, I would like to make a small summary here.

TextView has an ellipsize attribute, which is used to display the control when the text is too long:

1. Android: ellipsize = "start" -- The ellipsis is displayed at the beginning.
2. android: ellipsize = "end" -- The ellipsis is displayed at the end.
3. android: ellipsize = "middle" -- The ellipsis is displayed in the middle.
4. android: ellipsize = "marquee"-displayed as a running horse light (horizontal movement of the animation)

Set ellipsize = "end" to display the effect.

After the change, it looks much better !!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.