问题描述
这似乎是一个Android系统范围内的问题,您可以在API演示下看到视图 - >进度条 - >对话框
This seems to be an Android-wide problem, which you can see in API demos under Views -> Progress Bar -> Dialogs.
基本上,如果你显示一个进度对话框,它按预期工作围绕第一次。如果您关闭它,并再次显示(不破坏活动或类似的东西),旋转图像停止旋转。在API演示您可以通过点击查看不确定,pressing回到关闭对话框,然后再次单击该按钮,看到这一点。
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.
我试图构建自己的进度对话框,但它显示了同样的问题,因为这个问题与进度旋转图像。
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.
推荐答案
如果您关闭一个对话框
,你一定不要再次显示相同的实例。无论是创建一个新的,或者使用隐藏()
,而不是的解雇()
。当使用隐藏()
你还是要辞退()
它时,不再需要。
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.
这篇关于安卓:进度对话框微调不旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!