使 Android Activity 看起来像对话框 [英] Make Android Activity looks like dialog

查看:30
本文介绍了使 Android Activity 看起来像对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在点击小部件时打开一个对话框.我已经解决了使用 android:theme="@android:style/Theme.Dialog" 为点击开始的活动设置皮肤的问题.不幸的是,我无法达到对话框的相同外观.

I am trying to open a dialog on widget click. I have solved the problem skinning the activity started on click with android:theme="@android:style/Theme.Dialog". Unfortunately I cannot reach the same look of a dialog.

这是结果:

来自小部件的对话框

相反,我想达到这个结果(当然按钮除外):

Instead, I would like to reach this result (except for the button, of course):

来自小部件的期望对话框

(您可以看到保持屏幕推送的小部件对话框)

(the widget dialog you can see keeping the screen pushed)

如您所见,存在一些差异:列表项的颜色、文本的颜色和列表项分隔符.是否有预定义的主题/样式来获得与标准对话框相同的外观?如果不是,要遵循哪些步骤才能达到该结果?

As you can see there are some differences: the color of the list items, the color of the text and the list item separator. Is there a predefined theme/style to obtain the same look of a standard dialog? If not, what are the steps to follow to reach that result?

我已经看到 FoxyRing 提供的小部件具有我想要的行为.

I have seen that the widget provided by FoxyRing has the behaviour I would like to have.

推荐答案

为什么不使用具有透明背景布局的传统" Main Activity

Why not use a "traditional" Main Activity with a transparent background layout

并从中调用标准对话框?

and call a standard dialog from it ?

...好吧,如果我理解正确的话,那会很容易搞定,不是吗?

... well if I understood you correctly, that would make the trick in a very easy way, isn't it ?

这篇关于使 Android Activity 看起来像对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆