Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
212 views
in Technique[技术] by (71.8m points)

android - I want a progress circle instead of progress dialog

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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"/>

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...