TextView some set strikethrough ellipsis underline font change etc.

Source: Internet
Author: User

Font Change

Textview.settypeface (Typeface.createfromasset (Getassets (), "Sthupo. TTF "));


Sthupo. TTF can download font files on the web and put them into the assets file.

Delete Line

Textview.getpaint (). SetFlags (Paint. Strike_thru_text_flag);

Ellipsis

只需要下边的设置:  textview.setSingleLine(); textview.setEllipsiz(TextUtils.TruncateAt.valueOf( "END" ));  在xml中设置如下:  android:singleLine= "true" android:ellipsize= "end"


Multiple TextView settings

In my profile, you can download and execute your own

Execution effects such as

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E1/wKioL1Xag16AsT2FAAlgL8p95lk454.jpg "style=" float: none; "title=" 1.jpg "alt=" Wkiol1xag16ast2faalgl8p95lk454.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E5/wKiom1XagUvDjsn5AAvXpBr49ws601.jpg "style=" float: none; "title=" 2.jpg "alt=" Wkiom1xaguvdjsn5aavxpbr49ws601.jpg "/>


This article from "Love Ji" blog, reproduced please contact the author!

TextView some set strikethrough ellipsis underline font change etc.

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.