【问题标题】:How can I evenly space the tabs in ViewPager?如何均匀分布 ViewPager 中的选项卡?
【发布时间】:2011-09-16 00:13:08
【问题描述】:

有没有人有关于在 ViewPager 中保持标签均匀分布的任何提示?

    <com.jakewharton.android.viewpagerindicator.TitlePageIndicator
    android:id="@+id/indicator" android:layout_height="wrap_content"
    android:layout_width="match_parent" android:background="#404040"
    android:paddingLeft="5dp" android:paddingRight="5dp" />

【问题讨论】:

    标签: java android android-viewpager


    【解决方案1】:

    目前还没有办法告诉小部件截断或淡化标题。但是,它在todo list 上。

    现在您可以自己将标题截断为可接受的长度,因为它们是独立提供的。你也可以非常雄心勃勃,潜入我的代码并帮助贡献这个功能:)

    我意识到这不是最好的解决方案,但由于最近大量空闲时间很少而且相距甚远,因此我没有时间正确实现此功能。

    仅供参考,上述问题上的fade 选项的作用类似于Kirill Grouchnikov's blog 中所述的Android 市场标签指示器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-20
      • 1970-01-01
      • 2011-11-30
      • 1970-01-01
      • 1970-01-01
      • 2011-04-04
      • 2013-03-04
      • 2016-07-09
      相关资源
      最近更新 更多