保持对话/活动始终在顶部 [英] Keep dialog/activity always on the top

查看:257
本文介绍了保持对话/活动始终在顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在其他活动的顶部保持对话/活动,无论用户是否在活动之间切换,都应该一直活着。

How to keep a dialog/activity on the top of other activities, no matter if user switch between activities,it should be alive all the time.

推荐答案

您可以使用相对布局作为父项,通过使用相对布局,可以与其他布局重叠。所以,你必须使用相对布局的两个子布局。在一个孩子中,您将有弹出窗口,而在另一个布局中,您必须不断更改布局。

You can use Relative layout as a parent, by using Relative Layout, you can overlap the other layout. So, you have to use to two child layout of relative layout. In the one child you will have popup, and in another layout you have to keep changing your layout..

如果您希望跨多个活动。您必须创建一个单独的布局,并将其包含在所有活动中,并创建一个界面来处理弹出窗口中的按钮事件。

If you want this across multiple activities. You must create a separate layout and include that in all activities, and create an interface to handle the button events in the popup.

您可以创建一个基础活动,具有上述布局,并将该活动扩展到您想要此布局的所有其他活动。

You can create a base activity, having above mentioned layout, and extends that activity in all other activities where you want this layout.


Yuvi

Regards, Yuvi

这篇关于保持对话/活动始终在顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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