Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – 分隔符不适用于带有viewpagerindicator和actionbarsherlock的TitlePageIndicator大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我注意到最新版本的ViewPagerInDicator,支持ICS样式分隔符,我试图按照问题和解决方案,但无论我做什么,我都无法让分隔符显示titlePageInDicator操作栏上的选项上.我添加了IcsLayout作为容器,放置了divider,showDividers和其他属性,但我仍然没有得到任何东西.这是我的布局(奇怪的是,如果我将IcsLayout切换到viewpager指示器,应用程序崩溃):
<com.actionbarsherlock.internal.widget.IcsLinearLayout xmlns:android="http://scheR_871_11845@as.android.com/apk/res/android"
    xmlns:app="http://scheR_871_11845@as.android.com/apk/res/com.sosick.android.brink"
    android:layout_width="match_parent"
    android:divider="#ffffff"
    android:showDividers="middle"
    android:dividerPadding="8dp"
    android:dividerHeight="10dp"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.viewpagerinDicator.titlePageInDicator
        android:id="@+id/tpi_header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        textColor="@color/text_light"
        android:BACkground="@drawable/ab_stacked_solid_brink"
        app:toPPADding="10dp"
        app:footerPadding="15dp"
        app:footerColor="#a4ded7"
        app:footerInDicatorHeight="2dp"
        app:footerInDicatorStyle="underline"
        app:footerLineHeight="2dp"
        app:SELEctedBold="false" />

    <android.support.v4.view.ViewPager
        android:id="@+id/vp_pages"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</com.actionbarsherlock.internal.widget.IcsLinearLayout>

解决方法

您需要在样式中声明divider params,而不是在布局xml中声明.

../res/values/styles.xml:

<style name="StyledInDicators" parent="@android:style/Theme.Light">
    <item name="vpiIconPageInDicatorStyle">@style/CustomIconInDicator</item>
</style>

<style name="CustomIconInDicator" parent="Widget.TabPageInDicator">
    <item name="android:divider">@drawable/custom_tab_inDicator_divider</item>
    <item name="android:showDividers">middle</item>
    <item name="android:dividerPadding">10dp</item>
</style>

在您的活动清单中:

<activity
        android:name=".SampleIconsDefault"
        android:label="Icons/Default"
        android:theme="@style/StyledInDicators"> 
</activity>

大佬总结

以上是大佬教程为你收集整理的android – 分隔符不适用于带有viewpagerindicator和actionbarsherlock的TitlePageIndicator全部内容,希望文章能够帮你解决android – 分隔符不适用于带有viewpagerindicator和actionbarsherlock的TitlePageIndicator所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。