Android Image Dialog/Popup(Android 图像对话框/弹出窗口)
问题描述
是否可以在 Android 应用程序中仅显示一个图像弹出/出现?它类似于覆盖 AlertDialog 的普通视图,因此它只包含一个图像而没有其他内容.
Is it possible to have just an image popup/come-up in an Android application? It's similar to an overriding the normal view of an AlertDialog so that it contains just an image and nothing else.
解决方案: 感谢@blessenm 的帮助,我找到了答案.将活动屏蔽为对话框似乎是理想的方式.以下是我使用的代码.应用程序可以根据需要调用此对话框样式的活动,就像启动新活动一样
ImageDialog.java
your_dialog_layout.xml
为 Activity 设置以下样式以完成此操作至关重要:
styles.xml
最后一步是在清单中为 Activity 声明此样式,如下所示:
推荐答案
如果你只是想使用一个普通的对话框,像这样应该可以工作
If you just want to use a normal dialog something like this should work
image_layout.xml
image_layout.xml
这篇关于Android 图像对话框/弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!