【发布时间】:2011-06-18 21:21:17
【问题描述】:
我阅读了文档,但无法进行转换。事件的流程应该是什么样的?谁叫谁?
假设我想要一个调用 init() 的活动来绘制线 a,并调用 go 进行 5 秒的过渡到线 b。我需要对这段代码做什么?
public class Fun extends View
{
Drawable a;
Drawable b;
TransitionDrawable t;
public Fun(Context context)
{
super(context);
a = new LineA();
b = new LineB();
Drawable ray[] = {a,b};
t = new TransitionDrawable( ray );
}
@Override
protected void onDraw(Canvas canvas)
{
t.draw(canvas);
}
public void init()
{
t.resetTransition();
}
public void go()
{
t.startTransition(5000);
}
谢谢!
【问题讨论】:
标签: android animation graphics view drawable