ActionBar tabs height

前端 未结 3 1940
借酒劲吻你
借酒劲吻你 2020-12-09 21:53

I want to change default ActionBar tab\'s height, but can\'t find any info about. Is there some style attribute or method to set height of tabs? Thanks.

相关标签:
3条回答
  • 2020-12-09 22:37

    This is how you style the tabs. Although, I was having trouble actually getting the height to change. I'm not sure you can set a height via a Style to the TabView. You may have to create custom View and apply that to your tabs in your code. All the styles and attributes you need to reference are in the SDK. Look in the Values folder of the platform version you're working with. That's how I typically find out how to do this.

    <style name="Widget.Holo.Tab" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
        <item name="android:height">#dp</item>
    </style>
    
    <style name="Your.Theme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarTabStyle">@style/Widget.Holo.Tab</item>
    </style>
    
    0 讨论(0)
  • 2020-12-09 22:44

    You have to change the height of the actionbar in order to change the height of the tabs.

    theme.xml

    <style name="YourTheme" parent="@android:style/Theme.Holo">
        <item name="android:actionBarTabStyle">@style/tab_nav</item>
        <item name="android:actionBarTabTextStyle">@style/tab_nav_text</item>
        <item name="android:actionBarSize">80dp</item>
        ..
    </style>
    
    0 讨论(0)
  • 2020-12-09 22:47

    Be Aware that using

    android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"
    

    instead of

    android:theme="@android:style/Theme.Holo.Light.NoActionBar"
    

    leads to the following problem: if you switch from [NoActionBar Activity] to [ActionBar Activity] ActionBar will JUMP

    0 讨论(0)
提交回复
热议问题