Gepro
Gepro

Reputation: 583

Android - Smaller ActionBar Tabs

I want to have smaller ActionBar Tabs. At the top there is the ActionBar and in next row the Tabs, have same height as ActionBar. How can I change the height of tabs ? I am sure with a style...

my current tries, no success:

<resources xmlns:android="http://schemas.android.com/apk/res/android">

<!-- THEMES -->
<style name="actionBarTabTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="@android:attr/actionBarTabTextStyle">@style/actionBarTabTextStyle</item>
    <item name="@android:attr/actionBarTabBarStyle">@style/actionBarTabBarStyle</item>
    <item name="@android:attr/actionBarTabStyle">@style/actionBarTabStyle</item>
</style>

<!-- STYLES -->
<style name="actionBarTabTextStyle" parent="android:Widget.Holo.Light.ActionBar.TabText.Inverse">
    <item name="android:textColor">@color/main</item>
    <item name="android:textSize">14sp</item>
    <item name="android:padding">0dp</item>
</style>

<style name="actionBarTabBarStyle">
    <item name="android:background">@color/white</item>
    <item name="android:padding">0dp</item>
    <item name="android:height">3dp</item>
</style>

<style name="actionBarTabStyle"> <!-- This style kills the design --> 
    <item name="android:height">3dp</item>
</style>

Upvotes: 2

Views: 3735

Answers (2)

Ahmad
Ahmad

Reputation: 72563

Use this:

<style name="actionBarTabTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarTabTextStyle">@style/actionBarTabTextStyle</item>
    <item name="android:actionBarTabBarStyle">@style/actionBarTabBarStyle</item>
    <item name="android:actionBarTabStyle">@style/actionBarTabStyle</item>
</style> 

<style name="actionBarTabBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
    <item name="android:background">@color/white</item>
    <item name="android:padding">0dp</item>
    <item name="android:height">3dp</item>
</style>

Upvotes: 1

Zyoo
Zyoo

Reputation: 773

Maybe you should give the parent of these style

<style name="actionBarTabBarStyle" parent="android:style/Widget.Holo.Light.ActionBar.TabBar">
    <item name="android:background">@color/white</item>
    <item name="android:padding">0dp</item>
    <item name="android:height">3dp</item>
</style>

<style name="actionBarTabStyle" parent="android:style/Widget.Holo.Light.Tab"> <!-- This style kills the design --> 
    <item name="android:height">3dp</item>
</style>

Upvotes: 0

Related Questions