Attribute values under Android Selector

Source: Internet
Author: User

State_pressed, state_checked, state_pressed, state_selected, state_focused, state_enabled, and other States:

Android: state_pressed

If it is true, the image is displayed when it is clicked. If it is false, it is displayed by default when it is not pressed.

Android: state_focused

True: The value is displayed when the focus is obtained. False: The default value is displayed when the focus is not obtained.

Android: state_selected

True: The image is displayed when it is selected; false: The image is displayed when it is not selected.

Android: state_checkable

True: The image is displayed when the checkbox function is enabled. False: The image is displayed when the checkbox function is unavailable.

Android: state_checked

True: The image is displayed when the checkbox is selected; false: The image is displayed when the checkbox is selected.

Android: state_enabled

True: The image is displayed when the component is available; false: The image is displayed when the component is unavailable.

Android: state_window_focused

True: displays the image when the activity gets the focus at the beginning; false: displays the image when the focus is not at the beginning.

<? XML version = "1.0" encoding = "UTF-8"?>
<Selector xmlns: Android = "http://schemas.android.com/apk/res/android">

<Item Android: state_pressed = "true"

Android: drawable = "@ drawable/button_pressed"/> <! --
Pressed -->

<Item Android: state_focused = "true"

Android: drawable = "@ drawable/button_focused"/> <! --
Focused -->

<Item Android: drawable = "@ drawable/button_normal"/> <! --
Default -->
</Selector>

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.