TabPageIndicator在不同的Android版本中看起来不同

时间:2015-04-18 13:14:13

标签: android android-viewpager android-styles viewpagerindicator tabpage

您好我正在使用ViewPagerIndicator库。

我的项目的目标版本是5.0.1。

在Lollipop版本中,它看起来很好,如下所示。

enter image description here

但是在Jelly Bean版本4.2.1(三星Galaxy)中,它看起来如下。

enter image description here

styles.xml:

<!-- TO CHECK WITH LIBRARY ADDED STYLES FROM THE LISTSAMPLES PROJECT -->
<style name="StyledIndicators" parent="@android:style/Theme.Light">
    <item name="vpiCirclePageIndicatorStyle">@style/CustomCirclePageIndicator</item>
    <item name="vpiLinePageIndicatorStyle">@style/CustomLinePageIndicator</item>
    <item name="vpiTitlePageIndicatorStyle">@style/CustomTitlePageIndicator</item>
    <item name="vpiTabPageIndicatorStyle">@style/CustomTabPageIndicator</item>
    <item name="vpiUnderlinePageIndicatorStyle">@style/CustomUnderlinePageIndicator</item>
</style>

<style name="CustomTitlePageIndicator">
    <item name="android:background">#18FF0000</item>
    <item name="footerColor">#FFAA2222</item>
    <item name="footerLineHeight">1dp</item>
    <item name="footerIndicatorHeight">3dp</item>
    <item name="footerIndicatorStyle">underline</item>
    <item name="android:textColor">#AA000000</item>
    <item name="selectedColor">#FF000000</item>
    <item name="selectedBold">true</item>
</style>

<style name="CustomLinePageIndicator">
    <item name="strokeWidth">4dp</item>
    <item name="lineWidth">30dp</item>
    <item name="unselectedColor">#FF888888</item>
    <item name="selectedColor">#FF880000</item>
</style>

<style name="CustomCirclePageIndicator">
    <item name="fillColor">#FF888888</item>
    <item name="strokeColor">#FF000000</item>
    <item name="strokeWidth">2dp</item>
    <item name="radius">10dp</item>
    <item name="centered">true</item>
</style>

<style name="CustomTabPageIndicator" parent="Widget.TabPageIndicator">
    <item name="android:background">@drawable/custom_tab_indicator</item>
    <item name="android:textAppearance">@style/CustomTabPageIndicator.Text</item>
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:textSize">16sp</item>
    <item name="android:dividerPadding">10dp</item>
    <item name="android:showDividers">middle</item>
    <item name="android:paddingLeft">2dp</item>
    <item name="android:paddingRight">2dp</item>
    <item name="android:fadingEdge">horizontal</item>
    <item name="android:fadingEdgeLength">8dp</item>

</style>

<style name="CustomTabPageIndicator.Text" parent="android:TextAppearance.Large">
    <item name="android:typeface">sans</item>
</style>

<style name="CustomUnderlinePageIndicator">
    <item name="selectedColor">#FFCC0000</item>
    <item name="android:background">#FFCCCCCC</item>
    <item name="fadeLength">1000</item>
    <item name="fadeDelay">1000</item>
</style>
<!-- UPTO THIS LINE -->
  1. 我做错了什么?
  2. styles.xml出了什么问题?
  3. 如果需要更多细节,请问我,我愿意提供。

0 个答案:

没有答案