简体   繁体   English

如何在带有选项卡的滑动视图中使用活动

[英]How to use activities in a swipe views with tabs

In one app, I would like to use three activities with a swipe view with three tabs;在一个应用程序中,我想使用三个带有三个选项卡的滑动视图的活动; each tab triggering an activity (In the doc I have read about ViewPager and fragments, but it is for a different purpose);每个选项卡触发一个活动(在文档中我已经阅读了有关 ViewPager 和片段的内容,但它用于不同的目的); if it is possible how can i do that ?如果可能的话,我该怎么做? if it is not, must i break my app in three app ?如果不是,我必须将我的应用程序分成三个应用程序吗? Thank you.谢谢你。

Having activities in tabs has been deprecated as a technique for over five years.在选项卡中进行活动已作为一项技术被弃用超过五年。

Whether you use fragments or views for your ViewPager pages is up to you.您是否为ViewPager页面使用片段或视图取决于您。

if it is not, must i break my app in three app ?如果不是,我必须将我的应用程序分成三个应用程序吗?

No, you can have multiple fragments or multiple views within one app.不,您可以在一个应用程序中拥有多个片段或多个视图。

Make one activity with three tabs and one ViewPager.使用三个选项卡和一个 ViewPager 制作一项活动。 Each tab then change fragments in the ViewPager每个选项卡然后更改 ViewPager 中的片段

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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