Android - 单击时淡入淡出图像按钮
我在布局中有一个图像按钮,并为其实现了 onclick 功能。现在,我想在“点击时”期间淡入图像按钮。如何在 android 中以编程方式淡入图像。提前致谢。
I have an image button in a layout and implemented the onclick functionality for the same. Now, i want to fade the image button during "on click". How to do fading the image programatically in android. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在按钮上实现动画。您必须有一个带有 alpha 元素的视图动画。阅读此内容: http://developer.android.com/guide/topics/ resources/animation-resource.html 如果您需要任何帮助,请写在这里...
You need to implement an animation on a button. You must have a View animation with a alpha element. Read this : http://developer.android.com/guide/topics/resources/animation-resource.html and if you need any help please write here...
像这样(我还没有测试过,但应该可以),但是你需要有“褪色”版本的 ImageButton 可绘制对象。
Like this (I havent tested it, but should work), but you need to have "faded" version of ImageButton drawable.
您可以按照以下方式进行操作:
This way is how you do it: