保持对话/活动始终在顶部

编程入门 行业动态 更新时间:2024-10-19 23:26:16
本文介绍了保持对话/活动始终在顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

更多推荐

保持对话/活动始终在顶部

本文发布于:2023-10-31 16:13:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546606.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!