是否有可能一个动画绘制,而无需通过查看走向何方? [英] Is it possible to animate a drawable without going through a View?

查看:95
本文介绍了是否有可能一个动画绘制,而无需通过查看走向何方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我指的是旧的Andr​​oid动画系统在这里,而不是与蜂窝中引入的财产anims。)

我想换我周围的头如何动画在图形页面标记。由于地图视图使用地图覆盖 S,并且由于覆盖既不看法也不公开其标记为查看 S,但作为可绘制 S,我寻找各种方法来一个动画绘制没有把它在一个视图容器中。

这是可能的呢?纵观Android的来源,它看起来好像动画和它的各种实现仅仅包含code来计算动画应用数学变换。同样,如 RotateDrawable 仅包含code来计算的旋转,再加上code,提请转化为绘制在画布。

然而,无论是包含code键使动画播放;我只能够使用它的时候看到一个动画播放通过 View.startAnimation(动画)

有没有播放动画或使用动画绘制没有方式查看


解决方案

  

我想换我围绕如何在一个MapView的动画标记头。


自己写的覆盖的作品如 ItemizedOverlay 但执行自己的动画,或者使用的ImageView 和经典的动画框架,或自己的绘图code。


  

有没有播放动画或使用动画绘制没有显示?一个办法


我还没有尝试过的 AnimationDrawable ItemizedOverlay ,所以如果一个帧一帧动画是一切你所需要的,这是至少值得一试。否则,同样,你又回到了做自己的覆盖,我害怕。

(I am referring to the old Android animation system here, not the property anims that were introduced with Honeycomb.)

I am trying to wrap my head around how to animate markers on a MapView. Since map views use map Overlays, and since overlays are neither views nor expose their markers as Views, but as Drawables, I am looking for ways to animate a drawable without putting it in a view container.

Is that possible at all? Looking at the Android sources, it looks as if Animation and its various implementations merely contain the code to compute the mathematical transformations an animation applies. Similarly, e.g. RotateDrawable only contains the code to compute the rotation, plus code that draws the transformed drawable to a canvas.

However, neither contain code to make an animation play; I was only able to see an animation play when using it through View.startAnimation(animation).

Is there a way to play animations or use an animated drawable without a View?

解决方案

I am trying to wrap my head around how to animate markers on a MapView.

Write your own Overlay that works like ItemizedOverlay but performs your own animations, either using ImageView and the classic animation framework, or your own drawing code.

Is there a way to play animations or use an animated drawable without a View?

I haven't tried an AnimationDrawable with ItemizedOverlay, so if a frame-by-frame animation is all you need, that's at least worth a shot. Otherwise, again, you're back to doing your own Overlay, I'm afraid.

这篇关于是否有可能一个动画绘制,而无需通过查看走向何方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆