1

I've maven project where ViewPagerIndicator added as submodule. Now I'm trying to add custom style to TabPageIndicator. Here is my styles code:

<style name="AppTheme" parent="@android:style/android:Theme.NoTitleBar">
    <item name="android:textColor">@color/TEXT</item>
    <item name="android:background">@null</item>
    <item name="vpiTabPageIndicatorStyle">@style/CustomTabPageIndicator</item>
</style>

<style name="CustomTabPageIndicator" parent="Widget.TabPageIndicator">
    <item name="android:textColor">@drawable/text_tab_bar_color</item>
    <item name="android:dividerPadding">10dp</item>
    <item name="android:showDividers">middle</item>
    <item name="android:paddingLeft">8dp</item>
    <item name="android:paddingRight">8dp</item>
    <item name="android:background">@null</item>
</style>

When I build project from Intellij IDEA everythig is ok. But when I try to build my project using maven build fails with folowing error:

[INFO] /<my_path>/styles.xml:6: error: Error: No resource found that matches the given name: attr 'vpiTabPageIndicatorStyle'.
[INFO] /<my_path>/styles.xml:9: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.TabPageIndicator'.

What can be wrong with my configuration?

4

2 回答 2

0

很可能您没有在构建路径中添加 ViewPagerIndicator。

于 2013-08-09T15:14:25.233 回答
0

就我而言,似乎没有在属性文件中使用 vpiTabPageIndicatorStyle 声明的资源。

执行以下操作消除了我的错误:

<resources>
    <declare-styleable name="ViewPagerIndicator">
        <!-- Style of the tab indicator's tabs. -->
        <attr name="vpiTabPageIndicatorStyle" format="reference"/>
    </declare-styleable>
</resources>
于 2014-10-11T05:39:23.747 回答