是否有可能一个动画绘制,而无需通过查看走向何方? [英] Is it possible to animate a drawable without going through a View?
问题描述
(我指的是旧的Android动画系统在这里,而不是与蜂窝中引入的财产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 mapOverlay
s, and since overlays are neither views nor expose their markers asView
s, but asDrawable
s, 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 likeItemizedOverlay
but performs your own animations, either usingImageView
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
withItemizedOverlay
, 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 ownOverlay
, I'm afraid.这篇关于是否有可能一个动画绘制,而无需通过查看走向何方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!