1. Download our Official Android App: Forums for Android!

Apps AppCompat Tab Bar, tabs headers large and can't shrink them!

Discussion in 'Android Development' started by MarKco, Jan 5, 2014.

  1. MarKco

    MarKco Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Feb 7, 2012

    Feb 7, 2012
    1
    0
    5
    Hello to everybody,
    I'm developing an app which makes use of appcompat. I'm adding some tabs to it by simply using
    [HIGH]ActionBar.Tab tab = getSupportActionBar().newTab();[/HIGH]
    I expected the tabs to be as large as the text I put in them, but it's not. They are equals in width, which is beautiful but makes them overflow when I have three or more tabs.

    I tried to style them by using
    HTML:
    1.     <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    2.         <item name="actionBarTabTextStyle">@style/TabTextStyle</item>
    3.     </style>
    4.  
    and them
    HTML:
    1.     <style name="TabTextStyle" parent="@style/Widget.AppCompat.ActionBar.TabText">
    2.         <item name="android:width">10dp</item>
    3.         <item name="android:padding">0dip</item>
    4.         <item name="android:textSize">5px</item>
    5.     </style>
    6.  
    it doesn't change anything, it's just like I didn't write these lines :-/ I put them in values-v11 and values-v14 as well, nothing happened.

    I'm testing with a Galaxy Nexus having Android 4.3 on it and on a Galaxy S with 4.3 as well.

    Does anybody know what could be wrong here?

    Thank you in advance
     

    Advertisement

Share This Page

Loading...