Android:进度对话框微调器不旋转 [英] Android: Progress Dialog spinner not spinning

查看:36
本文介绍了Android:进度对话框微调器不旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是 Android 范围内的问题,您可以在 API 演示中的 Views -> Progress Bar -> Dialogs 中看到.

This seems to be an Android-wide problem, which you can see in API demos under Views -> Progress Bar -> Dialogs.

基本上,如果您显示一个进度对话框,它会在第一次时按预期工作.如果您关闭它并再次显示它(不破坏活动或类似的东西),旋转的图像将停止旋转.在 API Demo 中,您可以通过单击Show Indeterminate"、按回以关闭对话框并再次单击按钮来看到这一点.

Basically, if you show a progress dialog, it works as expected the first time around. If you dismiss it and show it again (without destroying the activity or anything like that), the spinning image stops spinning. In the API Demo you can see this by clicking "Show Indeterminate", pressing back to dismiss the dialog, and clicking the button again.

我尝试构建自己的进度对话框,但它显示了同样的问题,因为问题在于ProgressBar"旋转图像.

I've tried constructing my own progress dialog, however it shows the same problem, as the problem is with the "ProgressBar" spinning image.

我想知道是否有人有解决此问题的方法.

I am wondering if anyone has a workaround for this problem.

推荐答案

如果你关闭一个 Dialog,你不能再次显示同一个实例.要么创建一个新的,要么使用 hide() 而不是 dismiss().使用 hide() 时,您仍然需要在不再需要时 dismiss().

If you dismiss a Dialog, you must not show the same instance again. Either create a new one, or use hide() instead of dismiss(). When using hide() you still have to dismiss() it when no longer needed.

这篇关于Android:进度对话框微调器不旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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