我已经能够使用 Android 的标准“ProgressDialog”来显示不确定的任务正在运行。
但我想使用“较小”的进度对话框“旋转器”,它用于某些不确定的任务标准 Android 应用程序,如 android Market(有一个小的旋转圆圈,实际上集成到应用程序窗口中(而不是漂浮在其顶部)。
有谁知道如何创建较小的进度对话框(或者有人可以指出我正确的方向)吗?
I've been able to use the standard "ProgressDialog" for android to show that an indeterminate task is running.
But I'd like to use the "smaller" progress dialog "spinner" that's used for indeterminate tasks in some of the standard Android applications like the android Market (there's a small spinning circle that's actually integrated into the application window (as opposed to floating on top of it).
Does anyone know how to create the smaller progress dialog (or can someone point me in the right direction)?
发布评论
评论(3)
尝试使用 ProgressBar 并将其添加到 LinearLayout,如下所示:
ProgressBar mSpinner = new ProgressBar(this);
mSpinner.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
mSpinner.setInminated(true);
lyt.addView(mSpinner);
Try using ProgressBar and adding it to LinearLayout as follows:
ProgressBar mSpinner = new ProgressBar(this);
mSpinner.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
mSpinner.setIndeterminate(true);
lyt.addView(mSpinner);
使用名为 ProgressBar 的内置 Adnroid 小部件。将其放在 xml 布局上。并根据您的要求将可见性设置为可见和不可见
Use the built in Adnroid widget called ProgressBar. put it on xml layout. and set visibility to visible and invisible as per your requirement
Activity 类在可用于此目的的标题区域。你指的是这个吗?
我假设除了标题栏之外,您在其他任何地方看到的都是 ProgressBar UI 小部件设置为不确定放置在视图中。
The Activity class has a built in ProgressBar in the Title area that can be used for this purpose. Is that what you are referring to?
I assume anywhere else you are seeing this other than in a title bar would just be a ProgressBar UI widget set to indeterminate that is placed in the view.