Android: Progress Dialog spinner not spinning(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:进度对话框微调器不旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android:进度对话框微调器不旋转


- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01