繁体   English   中英

如何创建和绘制在从视图扩展的 class 中创建的进度条

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

我想知道是否可以创建在从 class 视图扩展的 class 中创建的进度条?

我的意图是在我的 animation 中添加一个进度条,使用“On a View”结构在 android 中创建动画:

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

我尝试了休闲方式,在视图 class 中,但没有出现。

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);
    }
}

有什么建议吗?

问候

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM