1

ViewPagerIndicator がサブモジュールとして追加されたプロジェクトを作成しました。今、カスタム スタイルを に追加しようとしていTabPageIndicatorます。ここに私のスタイルコードがあります:

<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>

Intellij IDEA からプロジェクトをビルドすると、すべて問題ありません。しかし、maven ビルドを使用してプロジェクトをビルドしようとすると、次のエラーで失敗します。

[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'.

構成の何が問題になっている可能性がありますか?

4

2 に答える 2

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 に答える
0

ほとんどの場合、ビルド パスに ViewPagerIndicator を追加していません。

于 2013-08-09T15:14:25.233 に答える