带有导航架构组件的 ViewPager [英] ViewPager with Navigation architecture components

查看:31
本文介绍了带有导航架构组件的 ViewPager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

viewpager 对导航有什么用处吗?我找不到关于此的信息,我不明白如何做到这一点.

Are there any uses for navigation with the viewpager? I can not find information about this and I do not understand how this can be done.

我有一个简单的两个片段,需要放在 viewpager 中,如果可能的话,可以通过导航.

I have an simple two fragments which is need to put inside viewpager and if its possible via navigation.

推荐答案

根据 这个问题:

导航侧重于影响后退堆栈的元素,而标签不影响后退堆栈 - 您应该继续使用 ViewPager 和 TabLayout

Navigation focuses on elements that affect the back stack and tabs do not affect the back stack - you should continue to manage tabs with a ViewPager and TabLayout

这篇关于带有导航架构组件的 ViewPager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆