简体   繁体   中英

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. 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

http://s9.postimg.org/e24pqpl3z/Untitled.jpg

看一下Fragments ,这似乎是使用它们的最佳时机。

There are only 3 options to achieve what you want.

  • Second activity can be dialog (You already said you do it but you don't like).
  • Using fragments . (recommended)
  • Using layouts by playing with visibility, (not recommended in your case)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM