Honeycomb - AlertDialog 期间隐藏状态栏
我在显示 AlertDialog 时遇到了 Honeycomb (3.2) 中状态栏可见性的问题。在我的 HomeActivity 中,我通过以下代码将状态栏可见性设置为隐藏:
View v = findViewById(R.id.toplevelview);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
到目前为止,这效果很好,并且应该在我的整个应用程序中保持如此。但是,当我通过 AlertDialogBuilder 创建新的 AlertDialog 并显示它时,状态栏可见性不再隐藏。我是否必须再次明确设置状态栏可见性或其他什么?我尝试了一些东西,但没有任何主题可以工作。
谢谢你帮助我!
I have a problem with the status bar visibility in Honeycomb (3.2) while showing an AlertDialog. In my HomeActivity I set the status bar visibility to hidden by the following code:
View v = findViewById(R.id.toplevelview);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
So far this works great and should stay so in my whole application. But when I create a new AlertDialog via the AlertDialogBuilder and show it the status bar visibility isn't hidden any more. Do I have to set the status bar visibility explicitly again or something? I have tried a few things, but nothing themes to work.
Thanks for helping me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,我认为每个活动和对话框都需要设置它。
这可以工作,有点:
问题是,至少在我正在开发的 Honeycomb ROM 中(Flashback 10.3),当对话框显示时,你仍然会看到状态栏的短暂闪烁,或者看起来是这样。我是菜鸟,所以我可能会做错对话。
实际上,我知道我做的对话框是错误的,因为“onPrepareDialog”已被弃用(链接)。接下来我将弄清楚片段和片段管理器。
我仍然无法隐藏状态栏的唯一一次是弹出微调器的选项时。看来这应该是应用程序级别的设置......
Yep, I think each activity and dialog needs to set it.
This works, sort of:
The problem is, at least in the Honeycomb ROM I'm developing with (Flashback 10.3), you still get a brief flash of the status bar as the dialog is shown, or so it seems. I'm a noob, so I might be doing dialogs wrong.
Actually, I KNOW I'm doing dialogs wrong because "onPrepareDialog" is deprecated (linky). I'll be figuring out fragments and the fragment manager next.
The only other time I still can't hide the status bar is when the choices pop-up for a spinner. Seems like this should be an app level setting...