开发者

Android Button performClick

In order to fudge multitouch buttons, I set a massive invisible imageView over top of everything. The I just poll for where it was touched and call performClick on the button in that area under it. Now my problem is that performClick only calls the onClick method, and doesn't actually perform a legitimate button press, so there's no animation (color change etc). I have a custom xml for the buttons, and it worked fine without the imageView. I try using setPressed a开发者_如何学Cnd setEnabled, but the png never changes, and the button looks static. What am I missing?


How about tying a Boolean to each button. All the button logic does is flip flop the variable and maybe change an indicator (button color or text) to pushed/not pushed. Shouldn't be more than 3 or 4 lines of code executed per button press. Fire the heavy code when a 'do it' button is pressed. That would have to be faster than computing which button was pressed under the overlay...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜