我想要一个进度圈,而不是进度对话框 [英] I want a progress circle instead of progress dialog

查看:100
本文介绍了我想要一个进度圈,而不是进度对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在加载数据时在我的应用程序中显示一个进度环.我有一个活动,并且正在从一个活动转移到另一个活动,我正在解析一些xml数据,因此暂时要在解析完成之前,我要显示循环加载效果.

I want to show a progress Circle in my app while loading data. I have an activity and moving from one activity to another I am parsing some xml data so for the time being until the parsing is completed I want to show a circular loading effect.

推荐答案

您可以使用不确定的ProgressBar来实现圆形加载效果.这是您使用XML的方式:

You can use an indeterminate ProgressBar for the circular loading effect. Here is how you do it in XML:

<ProgressBar android:indeterminate="true"
            android:layout_width="50dp" android:layout_height="50dp"
            android:id="@+id/marker_progress" style="?android:attr/progressBarStyle"
            android:layout_gravity="center_vertical|center_horizontal"/>

您可以将高度和宽度更改为所需的高度.加载完成后,可以将其可见性更改为View.INVISIBLE或View.GONE

You can change the height and width to be what you want. When you are done loading, you can change it's visibility to View.INVISIBLE or View.GONE

这篇关于我想要一个进度圈,而不是进度对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆