lesson6 android studio progressbar的使用

布局

水平布局

   <ProgressBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/Widget.AppCompat.ProgressBar.Horizontal"
        android:max="100"
        android:id="@+id/pbar"/>

圆圈布局

   <ProgressBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/pbar"/>

设置可见性和不可见

myprogressbar.setVisibility(View.VISIBLE);
 myprogressbar.setVisibility(View.GONE);

水平布局下设置进度条位置

 myprogressbar.setProgress(1+myprogressbar.getProgress());
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 180,490评论 25赞 708
  • 原文链接:https://github.com/opendigg/awesome-github-android-u...
    IM魂影阅读 33,199评论 6赞 472
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 14,349评论 1赞 92
  • Sunflower LaiLai always looked tired during the daytime, ...
    Edwinn阅读 284评论 0赞 0
  • “往后你答应我,好好活着替我看看这盛世繁华,万年基业。” 这是他攥着我的手说的最后一句话。还没等到我的回答他的手...
    五二同阅读 474评论 2赞 3

友情链接更多精彩内容