android点击图片按钮后恢复原来的颜色

发布于 2024-11-16 13:31:37 字数 202 浏览 11 评论 0原文

我在 onClick() 方法中提到了以下内容: Ibutton1.setColorFilter(Color.argb(150, 155, 155, 155));// 单击按钮时,按钮会呈现灰色。其中 Ibutton1 是 Imagebutton 的实例

现在我希望在单击按钮并启动活动后应删除色调... 请帮忙

I have mentioned the following in the onClick() method:
Ibutton1.setColorFilter(Color.argb(150, 155, 155, 155));// this gives the button a gray tint when the button is clicked. where Ibutton1 is the instance of Imagebutton

Now I want that the tint should be removed after the button has been clicked and the activity has been started...
Plz help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

混浊又暗下来 2024-11-23 13:31:37

您始终可以为此使用选择器。在下面的链接中检查相同的内容:

http://developer.android.com/resources/tutorials/views/hello-formstuff.html

谢谢!

You can always use a selector for this.Check the same in the link below:

http://developer.android.com/resources/tutorials/views/hello-formstuff.html

Thanks!

椒妓 2024-11-23 13:31:37

尝试在所需事件上使用 lbutton1.clearColorFilter() 函数。

try using lbutton1.clearColorFilter() function on the desired event.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文