如何将一个活动显示为其他活动的弹出窗口? [英] How to show an Activity as pop-up on other Activity?
问题描述
我有一个活动A,视图中有一个按钮B.如果有人按下B键,那么我想要一个弹出窗口,该弹出窗口可以占据屏幕的一部分,从而使A在该区域不可见,但A的其余部分可见但不起作用.我该如何实现?
I have an Activity A, and there is a button B in the view. If somebody presses B then I want a pop-up which can take some part of screen making the A invisible in that area but rest of A is visible but not active. How can I achieve this?
推荐答案
如果要使用活动"而不是对话框"来执行此操作,则可以通过在清单中将活动的主题设置为android:theme="@android:style/Theme.Dialog"
来执行此操作-使活动看起来像一个对话框(浮动在其下面的任何内容之上).
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="@android:style/Theme.Dialog"
in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
这篇关于如何将一个活动显示为其他活动的弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!