Actionbarsherlock with Viewpagerindicator

末鹿安然 提交于 2019-12-06 12:41:51

问题


I have an app that is using Viewpagerindicator. I am using the tabs portion of it. I use a black background and the default blue indicator color. I wanted to add an actionbar to my app so I started using Actionbarsherlock. In order to get my tabs to show an the action bar to show I created my own them which is called in my manifest file. The theme I created is this:

<?xml version="1.0" encoding="utf-8"?>

<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is our main ActionBarSherlock theme -->
<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar">
</style>

<style name="Theme.VPI" parent="Theme.Styled">
      <item name="vpiTitlePageIndicatorStyle">@style/Widget.TitlePageIndicator</item>
      <item name="vpiTabPageIndicatorStyle">@style/Widget.TabPageIndicator</item>
      <item name="vpiTabTextStyle">@style/Widget.TabPageIndicator.Text</item>

</style>    

</resources>

When I run the app, I get my blue indicator color but the background of the entire app is white.

Originally I was how this code inside:

<style name="Theme.VPI" parent="Theme.Styled">
   <item name="vpiTabPageIndicatorStyle">@style/CustomTabPageIndicator</item>
</style>  

That gave me red indicators with a white background. I know the custom tabs are red with a white background and that is why I changed it from CustomTabPageIndicator to Widget.TabPageIndicator. However, I am still getting an all white background.

I have tried to just make my layout have a black background inside of my pageviewer, however when I do that, my buttons become really dark and unreadable.

My main question is to find where I can change the color inside of the Viewpagerindicator theme.

Any suggestions would be much appreciated. Thank You.


回答1:


Visit this example; Making ActionBarSherlock and ViewPagerIndicator play nice

Possible Bug in that example; Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException

Good Luck..!!



来源:https://stackoverflow.com/questions/12267660/actionbarsherlock-with-viewpagerindicator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!