简体   繁体   English

ViewPager - 同时进行垂直和水平实现

[英]ViewPager - vertical and horizontal implementation at the same time

Is it possible to do sliding among Fragments horizontally as well as vertically in the same FragmentActivity? 是否可以在相同的FragmentActivity中水平和垂直地在Fragments中进行滑动?

Let's say I have 4 fragments A, B, C and D. I want A and B to be able to slide between each other horizontally and A with C or B with D vertically. 假设我有4个片段A,B,C和D.我希望A和B能够在水平方向上相互滑动,A与C或B在垂直方向上滑动。

Is it even possible? 它甚至可能吗? Or is there any other way to achieve this using Fragments? 或者有没有其他方法可以使用Fragments实现这一目标?

I just built a DoubleFragmentViewpager library that should do what you want. 我刚刚构建了一个DoubleFragmentViewpager库 ,可以做你想要的。

I just tried it myself so maybe it's not that robust but you could give it a try. 我只是自己尝试过,所以也许它并不那么强大,但你可以尝试一下。

If you can afford not using fragments, I also recommand you the juliome10's DoubleViewPager . 如果你能负担得起不使用片段,我也建议你使用juliome10的DoubleViewPager

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

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