Setting of focus color when Android handles onitemclicklistener

Setting of focus color when Android handles onitemclicklistener

When we use onitemclicklistener to change the item to make it more prominent, we generally use the following code.

In this way, the focus will have such an effect:

If we create a new folder, such as human color and drawable, and then call the color through the XML file inside, the code is as follows.

The results after operation are shown in the figure below:

That is, color is more willing to accept a value directly, rather than through an XML file.

Thank you for reading, hope to help you, thank you for your support to this site!

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
分享
二维码
< <上一篇
下一篇>>