2.27学习总结

今天学习了控件5ProgressBar

    style="?android:attr/progressBarStyleHorizontal"   水平进度条   去掉后变为画圈
android:indeterminate="true"    进度条不精确显示进度
android:max="100"  进度条的最大值
android:progress  进度条已完成进度值


<Button
android:text="显示隐藏进度条"
android:onClick="click"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
public void click(View view){
if(progressBar.getVisibility()==View.GONE){
progressBar.setVisibility(View.VISIBLE);
}else {
progressBar.setVisibility(View.GONE);
}


}

<ProgressBar
android:id="@+id/pb2"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:layout_width="300dp"
android:layout_height="wrap_content"
/>
<Button
android:text="模拟下载"
android:onClick="load"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
public void load(View view){
int progress = progressBar2.getProgress();
progress +=10;
progressBar2.setProgress(progress);


}


posted @   代不动码  阅读(8)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示