java - 可滚动的 PagerTabStrip

标签 java android android-fragments

我已经搜索这个主题一段时间了,但找不到足够的资源或有关滚动 PagerTabStrip 的内容。我正在使用 FragmentStatePagerAdapter 并使用 getPageTitle(int position) 填充 PagerTabStrip。我想知道如何使 titles 可滚动。我想在停止或选择特定标题时滚动标题而不影响 View ,这就是 View 更新的时间。我一直在考虑使用 Horizo​​ntialListView 但不确定如何开始。希望向你学习。谢谢。

在文档上找到这个:

PagerTabStrip is an interactive indicator of the current, next, and previous pages of a ViewPager. It is intended to be used as a child view of a ViewPager widget in your XML layout. Add it as a child of a ViewPager in your layout file and set its android:layout_gravity to TOP or BOTTOM to pin it to the top or bottom of the ViewPager. The title from each page is supplied by the method getPageTitle(int) in the adapter supplied to the ViewPager.

最佳答案

我一直在网上搜索这个,但我没有得到任何相关资源。我刚刚发现了另一个名为 actionsherlock 的库,它可以在不影响 View 的情况下滚动选项卡,这正是我所需要的,而不是使用 PagerTabStrip 的监听器。

关于java - 可滚动的 PagerTabStrip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17944681/

相关文章:

java - Java的扫描仪出现问题:InputMismatchException

java - 将作用域 bean Autowiring /注入(inject)到 Controller 方法中

android - 如何从应用程序项目外部使用 NDK 构建系统编译 native 库?

Android - 限制只有一位小数点进入 EditText

android - 如何将 Android MVVM 模式与 fragment 一起使用?

java - JTable 插入行并刷新

java - MVC在哪里保留对 Controller 的引用?

java - Libgdx 暂停()方法不起作用

android - 二进制 XML 文件行 #22 : Error inflating class fragment

android - 方向改变时键盘消失