开发者

How to create and draw a progress bar that is created in a class that extends from View

I want to know if it is possible to create a progress bar that is created in a class that extends from the class View?

My intention is to add a progress bar in my animation, using the "On a View" structure for creating animations in android:

http://developer.android.com/guide/topics/graphics/index.html

I tried with the fallowing way, in 开发者_如何学Cthe view class, but it didn't appear.

public class CustomDrawableView extends View {
    private ProgressBar mProgress;

    public CustomDrawableView(Context context) {
        super(context);
        mProgress = new ProgressBar(context, null, android.R.attr.progressBarStyleSmall);
    }

    protected void onDraw(Canvas canvas) {
        mProgress.draw(canvas);
    }
}

Any suggestion?

Greetings


try this Image in Canvas with touch events

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜