简体   繁体   English

如何在Android中实现可滑动选项卡主机

[英]How To Implement A Swipable Tab Host In Android

在此处输入图片说明

I want to make a tab host in such a way that if I swipe left inside the tab host, a new tab will appear from the right and pushes the rest towards the left. 我想以这样一种方式制作标签主机:如果我在标签主机内向左滑动,则会从右侧出现一个新标签,并将其余标签推向左侧。 I want the new tab that would appear will be able to position itself properly. 我希望出现的新标签页能够正确定位自己。 I want smooth transition effect in swiping, so can anyone give me idea on how to achieve this effect? 我想要滑动时的平滑过渡效果,所以谁能给我关于如何实现此效果的想法? any sample codes? 任何示例代码? or any useful links containing tutorials? 或包含教程的任何有用链接? I googled this up and sadly no result showing what I want. 我用谷歌搜索,可惜没有显示我想要的结果。

One way that I could think of is applying a scroll view there that could only be scrolled horizontally. 我能想到的一种方法是在其中应用只能水平滚动的滚动视图。 But one problem I am worrying is the automatic positioning of the item. 但是我担心的一个问题是物品的自动定位。 How can I achieve that? 我该如何实现?

Please help. 请帮忙。 Many Thanks! 非常感谢!

it seems that you are looking for ViewPager and PagTabStrip Example . 看来您正在寻找ViewPagerPagTabStrip示例 google out on both topic and you will definitely find your ans. 用Google搜索这两个主题,您肯定会找到答案。

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

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