Change the menu's color after being pressed
So I can change the color of a options menu item no problem. However, I would like to change the开发者_开发知识库 color that menu items flash when pressed from green to orange. Everywhere I look has nothing on this. Please help.
If you want it to change the color of the menu item while having your finger pressed down on the button, before actually releasing it, you likely want to look into an onKeyDown() event handler. In that handler, I would change the color of the menu item, and then in the onKeyUp() handler, change the color back.
There might be a more elegant way of handling this, however. You can visit the Android SDK UI Event Handlers page for more information.
精彩评论