官網有很詳細的介紹:詳查http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList
android:drawable 放置一個drawable資源
android:state_pressed 是否按下,一個按鈕點擊定義。
android:state_focused 是否取得焦點。
android:state_hovered 光标是否懸停,通常與focused state相同,它是4.0的新特性
android:state_selected 被選中時的定義,與focus state不完全一樣,如一個list view 被選中的時候,裡面的子组件(按鈕)可能透過方向鍵,被選中了。
android:state_checkable 组件是否能被check。如:RadioButton是可以被check的。
android:state_checked 被checked了,如:一个RadioButton可以被check了。
android:state_enabled 能够接受触摸或者点击事件
android:state_activated 被激活(这个麻烦举个例子,不是特明白)
android:state_window_focused 应用程序是否在前台,当有通知栏被拉下来或者一个对话框弹出的时候应用程序就不在前台了
沒有留言:
張貼留言