【问题标题】:Android ViewPagerIndicator - UnderlinePageIndicator on top instead of bottom?Android ViewPagerIndicator - UnderlinePageIndicator 在顶部而不是底部?
【发布时间】:2013-04-22 14:38:55
【问题描述】:
我正在使用 ActionBarSherlock + HoloEverywhere + ViewPagerIndicator 库。
- 有没有办法将 UnderlinePageIndicator 放在顶部而不是底部?
- 在 Jelly Bean 上,UnderlinePageIndicator 不会在几站时自动隐藏,而在 GingerBread 上却可以完美运行。有什么想法吗?
【问题讨论】:
标签:
android
actionbarsherlock
viewpagerindicator
【解决方案1】:
您可以使用 TabPageIndicator 并通过编辑名为 vpi_tab???_holo 的九个补丁 PNG 来更改下划线的外观。每个屏幕密度有 6 个。
【解决方案2】:
只要设置你想要的高度:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.viewpagerindicator.UnderlinePageIndicator
android:id="@+id/pageIndicator"
android:layout_height="2dp"
android:layout_width="fill_parent"
/>
<android.support.v4.view.ViewPager
android:id="@+id/vp_pages"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>