Make full use of Android predefined styles

Source: Internet
Author: User

Font Size

For controls that can display text (such as textview edittext radiobutton button checkbox chronometer), you sometimes need to control the font size. The Android platform defines three font sizes.

"? Android: ATTR/textappearancelarge"

"? Android: ATTR/textappearancemedium"

"? Android: ATTR/textappearancesmall"

Usage:

Android: textappearance = "? Android: ATTR/textappearancelarge"
Android: textappearance = "? Android: ATTR/textappearancemedium"
Android: textappearance = "? Android: ATTR/textappearancesmall"

Or

Style = "? Android: ATTR/textappearancelarge"
Style = "? Android: ATTR/textappearancemedium"
Style = "? Android: ATTR/textappearancesmall"

Font color

Android: textcolor = "? Android: ATTR/textcolorprimary"
Android: textcolor = "? Android: ATTR/textcolorsecondary"
Android: textcolor = "? Android: ATTR/textcolortertiary"
Android: textcolor = "? Android: ATTR/textcolorprimaryinverse"
Android: textcolor = "? Android: ATTR/textcolorsecondaryinverse"

Progressbar

Style = "? Android: ATTR/progressbarstylehorizontal"
Style = "? Android: ATTR/progressbarstylelarge"
Style = "? Android: ATTR/progressbarstylesmall"
Style = "? Android: ATTR/progressbarstylesmalltitle"

Delimiter

Horizontal:

<View Android: layout_width = "fill_parent"
Android: layout_height = "1dip"
Android: Background = "? Android: ATTR/listdivider "/>

Vertical:

<View Android: layout_width = "1dip"
Android: layout_height = "fill_parent"
Android: background = "? Android: attr/listDivider "/>

CheckBox

Style = "? Android: attr/starStyle"

TextView similar to the title bar Effect

Style = "? Android: attr/listSeparatorTextViewStyle"

Other useful styles

Android: layout_height = "? Android: attr/listPreferredItemHeight"

Android: paddingRight = "? Android: attr/scrollbarSize"

Style = "? Android: attr/windowTitleBackgroundStyle"

Style = "? Android: attr/windowTitleStyle"

Android: layout_height = "? Android: attr/windowTitleSize"

Android: background = "? Android: attr/windowBackground"

For more details, see the R. attr class in the SDK documentation.

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.