Usage Summary of selector based on Android background

2. Method 2: drawable drawable = getresources(). Getdrawable (r.drawable. XXX); ListView.setSelector(drawable); However, sometimes the list is black. You need to add Android: cachecolorhint = "@ Android: color / transparent" to make it transparent. Related properties:

android:state_ Selected is the selected Android: state_ Focused is Android: state that gets the focus_ Pressed yes, click Android: state_ Enabled is to set whether to respond to events. It refers to all events

According to these States, you can also set the selector effect of the button. You can also set the selector to change the text state in the button. The following is the text effect in the configuration button: drawable / button_ font.xml

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>