开发者

Can an View play its animation out of its parent?

开发者 https://www.devze.com 2023-04-04 12:32 出处:网络
I have some ImageViews in a TableLayout\'s TableRow. When I start an animation of one ImageView using the following code:

I have some ImageViews in a TableLayout's TableRow. When I start an animation of one ImageView using the following code:

ImageVi开发者_如何学Goew image = (ImageView)findViewById(id);
TranslateAnimation a = new TranslateAnimation(0, 0, 0, 80);             
a.setDuration(500);
image.startAnimation(a);

the image is expected to move downwards. But unfortunately it's in a TableRow, so I can see the image moves "in the backstage of the row". Any ideas? I can't use other layouts because of a lot of existing codes.


The answer is no. Animations change properties of an view, but can't take it out of its parent. At last I gave up and use another layout.

0

精彩评论

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