Android ImageView循环颜色
我想快速循环在图像视图中加载的图像的色调。这就是我目前所拥有的。我还为 myimage
使用透明背景色。但这不起作用。
AlphaAnimation transparency = new AlphaAnimation(1, 9);
transparency.setRepeatCount(Animation.INFINITE);
transparency.start();
ImageView myimage = (ImageView) findViewById(R.id.myimageid);
myimage.setBackgroundColor(0x66F00000);
myimage.startAnimation(transparency);
什么才能使其正常工作?
I would like to quickly cycle the tint of an image that I have loaded within an imageview. This is what I currently have. I am also using a transparent background color for myimage
. This does not work though.
AlphaAnimation transparency = new AlphaAnimation(1, 9);
transparency.setRepeatCount(Animation.INFINITE);
transparency.start();
ImageView myimage = (ImageView) findViewById(R.id.myimageid);
myimage.setBackgroundColor(0x66F00000);
myimage.startAnimation(transparency);
What will make this work properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自参考:
假设您想要从 10% 到 90% 进行动画处理,则需要将参数设置为
new AlphaAnimation(0.1f, 0.9f);
From the reference:
Assuming you want to animate from 10% to 90%, you need to set the parameters as
new AlphaAnimation(0.1f, 0.9f);