开发者

Creating a loading circle/wheel (similar to the one in ProgressDialog, but without the dialog)

As you know, when using a ProgressDialog a "popup"/dialog appears in which a circle/wheel shows the progress.

I am interested in drawing this wheel out from the dialog box, and only displaying this wheel, still indicating progress.

Main reason to want this, is the fact that I have some sort of "intro screen" which will show a logo and this progress wheel just below, which indicates that the application is loading various content.

This is (or could be) the wheel in ques开发者_开发问答tion:

Creating a loading circle/wheel (similar to the one in ProgressDialog, but without the dialog)

It wouldn't hurt if the wheel could be smaller than it appears in a regular ProgressDialog.

(I'm using AsyncTask to load the content while this wheel is displayed.)

Any suggestions?


You can use the pre-defined style Android provides for an indeterminate ProgressBar, like this:

<ProgressBar
    style="?android:attr/progressBarStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
/>

If you want it to be smaller, use the progressBarStyleSmall style instead.

From here you can set the visibility of the ProgressBar to make it appear/disappear whenever you want.


Have you considered using a ProgressBar and setting setIndeterminate(true);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜