保持对话/活动总是在顶部

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

如何保持一个对话框/活动在其他活动上,不管活动之间的用户切换,它应该是活着的所有时间。

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

更多推荐

保持对话/活动总是在顶部

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

发布评论

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

>www.elefans.com

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