Android Selector Item Property Daquan (Button press different effect)

Source: Internet
Author: User

<SELECTOR>&NBSP;
          must. Must be a root element. Contains one or more <item> elements.  
             xmlns:android 
                   string, must. Defines the namespace of the XML, which must be  
                     "Http://schemas.android.com/apk/res/android" .  

android:state_pressed                

Boolean. "True" indicates the use of a pressed state (for example, a button is pressed); "false" indicates a non-pressed state. android:state_focused

Boolean. "True" indicates that the focus state is used (for example, using a rolling ball/d-pad
Focus button); "False" indicates the use of a non-focused state.
android:state_selected
Boolean. "True" indicates that the selected state is used (for example, tab-Open); "false"
Represents a non-checked state for use.
android:state_checkable
Boolean. "True" indicates that the status can be checked, "false" indicates non-available
Tick status use. (Useful only for components that can toggle tick-not tick.) )
android:state_checked
Boolean. "True" indicates that the check status is used; "false" indicates a non-tick status.
android:state_enabled
Boolean. "True" indicates the usable state is used (can receive touch/click events);
"False" indicates an unavailable state to use.
android:window_focused
Boolean. "True" indicates that the application window has the focus when used (application
in the foreground); "false" means use when there is no focus (for example, the notification bar pulls
Or the dialog box appears).

Note: Remember that the first item in StateList that matches the current state will be used. Therefore, if the first item is not

If there is any state attribute, then it will be used every time, which is why the default value must always be at the end (as in the following

As shown in the example).

Android Selector Item Property Daquan (Button press different effect)

Related Article

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.