如何WhatsApp的弹出式通知工作?弹出式、通知、工作、WhatsApp

由网友(你的微笑太刺眼)分享简介:我试图模仿的WhatsApp的弹出通知。(如果你还没有看到它,它可能是一个有点难以让你明白这一点。)下面是给一个更清晰的视角的图像。I am trying to mimic the pop-up notification of WhatsApp.(If you have not seen it, it might...

我试图模仿的WhatsApp的弹出通知。(如果你还没有看到它,它可能是一个有点难以让你明白这一点。)下面是给一个更清晰的视角的图像。

I am trying to mimic the pop-up notification of WhatsApp. (If you have not seen it, it might be a bit hard for you to understand this.) Below is an image to give a clearer perspective.

有人建议,这可能使用的有 Theme.Holo.Light.Dialog.Alert 主题的oridnary活动来完成。然而,当我实现了,我得到了它应该是空的像一个对话框,该活动充满的意见(另一半)的一半,呈现出白色背景。也就是说,我没有对话的感觉。

Some suggested that this might be done using an oridnary activity which has the Theme.Holo.Light.Dialog.Alert theme. However, when I implemented that I got half of the activity full with the views (and the other half) which is supposed to be empty like a dialog, showing a white background. ie, I did not have the dialog feel.

Morever,当设备处于待机模式(电源按钮pressed)和锁定,WhatsApp的是能够绕过这一点,显示上面弹出的对话框中(或活动,或其他)。

Morever, when the device is in standby mode (power button pressed) and locked, whatsapp is able to bypass that and show the popup dialog (or activity, or whatever) above that.

任何想法如何实现这一点?

Any ideas how to implement this ?

推荐答案

天啊!几个小时后,我找到了解决办法!

Oh god! After hours, I found the solution!

请参考链接: http://developer.android.com/guide /topics/ui/dialogs.html#CustomLayout

这是非常容易,你只需要设置活动的主题@android:款式/ Theme.Holo.Dialog清单中,如:

It's extremely easy, you just need to set up the theme of the activity to @android:style/Theme.Holo.Dialog in manifest like:

<activity android:theme="@android:style/Theme.Holo.Dialog" >
阅读全文

相关推荐

最新文章