[英]android 2 activities on the same screen
I've a tabBar with 4 tabs, the Main tab is the first one, and when I click the second one I want do display another activity above the main activity in the half of the screen, reducing the opacity of the main. 我有一个带有4个标签的tabBar,Main标签是第一个标签,当我单击第二个标签时,我想在屏幕的一半上方的main活动上方显示另一个活动,以减少main的不透明度。 I'm doing this with a Dialog but it's not the result I want.
我正在使用对话框执行此操作,但这不是我想要的结果。 What are the best way to do this?
最好的方法是什么?
example image 示例图片
看一下Fragments ,这似乎是使用它们的最佳时机。
There are only 3 options to achieve what you want. 只有3种选择可实现您想要的。
A Fragment represents a behavior or a portion of user interface in an Activity.
片段表示活动中的行为或用户界面的一部分。 You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities
您可以在一个活动中组合多个片段以构建多窗格UI,并在多个活动中重用一个片段
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.