TextView Setting Font Color

Source: Internet
Author: User
Tags color representation
TextView TextView = null;//The first type: Use the system's own color to set, such as: Textview.settextcolor (Android.graphics.Color.BLUE); The second kind: 0XFFFF00FF is the int type of data, grouping the 0x|ff|ff00ff,0x is the mark that represents the color integer, FF is the transparency, the FF00FF represents the color, note: Here FFFF00FF must be 8 color representation, Do not accept the ff00ff of this 6 color representation, such as: Textview.settextcolor (0XFFFF00FF);//Third: The use of the color class, such as: Textview.settextcolor ( Android.graphics.Color.parseColor ("#87CEFA"));//Fourth://through the acquisition of resource files to set up. Depending on the situation r.color.red can also be r.string.red or r.drawable.red,//of course, the premise is to do the corresponding configuration file in the corresponding configuration, such as (XML tag)://<color name= "Red" > #FF0000 </color>//<drawable name= "Red" > #FF0000 </drawable>//<string name= "Red" > #FF0000 < /string>//such as: Textview.settextcolor (Android.graphics.Color.parseColor ("#87CEFA"));

TextView Setting Font Color

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.