(turn) SetTextColor () parameter setting method

Source: Internet
Author: User

 settextcolor () parameter setting methodCategory: Android interface research 2011-12-09 23:27 11160 people read reviews (2) favorite reports

Check the information. The parameters of SetTextColor () should be written in this form:

SetTextColor (0XFF0000FF);//0xff0000ff is the data of type int, group the 0x| Ff|0000ff,0x is a marker that represents a color integer, FF is a representation of transparency, 0000FF is a color, note: Here 0xff0000ff must be a color representation of 8, do not accept 0000FF as a color representation of this 6.

In addition, you can also use the system's own color class

SetTextColor (Android.graphics.Color.BLUE);

There is also the use of resource files to set up

SetTextColor (This.getresources (). GetColor (R.color.blue));//set by obtaining a resource file. Depending on the situation r.color.blue can also be r.string.blue or r.drawable.blue, of course, if necessary in the corresponding configuration file to do the corresponding configuration, such as:

<color name= "Blue" > #0000FF </color>

<drawable name= "Blue" > #0000FF </drawable>

<string name= "Blue" > #0000FF </string>

Excerpt from: http://blog.csdn.net/chiuan/article/details/7058686

(turn) SetTextColor () parameter setting method

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.