The activity using ViewPagerIndicator needs to have the appropriate styles in its theme.
使用 ViewPagerIndicator 时 , 布局文件报的错
Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.
Failed to find style 'vpiCirclePageIndicatorStyle' in current theme
解决方法:
在style.xml 文件中 加入 以下行,即让 AppTheme 包含 vpiCirclePageIndicatorStyle 的 样式
|
|
<resources>
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<style name="AppTheme" parent="android:Theme.Light.NoTitleBar">
<item name="vpiCirclePageIndicatorStyle">@style/TabStyle</item> -
</style>
<style name="TabStyle" parent="Widget.TabPageIndicator">
<item name="android:textColor">#FF33AA33</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">italic</item>
<item name="android:paddingLeft">16dp</item>
<item name="android:paddingRight">16dp</item>
<item name="android:fadingEdge">horizontal</item>
<item name="android:fadingEdgeLength">8dp</item>
</style>