2012-07-30 59 views
1

下面是绘制矩形所需的代码。如果不使用一些Runnables使其闪烁,它将如何实现?有没有这样的选择?或者,也许我应该把闪烁的背景gif?android - 以编程方式为ShapeDrawable打开/关闭眨眼/鳍状肢动画/效果(RectShape)

ShapeDrawable ohMyShape = new ShapeDrawable(new RectShape()); 
ohMyShape.getPaint().setColor(Color.RED); 
ohMyShape.getPaint().setStyle(Style.STROKE); 
ohMyShape.setBounds(x, y, x+l, y+h); 
ohMyShape.draw(canvas); 

我的意思是这样

ohMyShape.getPain().setAnimation(Animation.BLINK); 

真的会去除疼痛。

+0

我认为这种沉默意味着没有办法做到这一点。 – duru 2012-07-30 22:35:50

回答

1

看起来像迄今为止最简单的方法是,使用2个图像并在屏幕上绘制它们。其中一个图像应该是一个闪烁的gif,另一个是不闪烁的版本。

谢谢任何​​参与这个独白的人。