Customizing ActionBar Tabs on Android 4

2020-02-28 02:05发布

I'm trying to customize Tabs on my ActionBar. I just want to align tabs to phone screen and make it stretchable for various screens. But all I get is this:

enter image description here

The code I use for the theme is this:

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

    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarTabTextStyle">@style/MyActionBarTabTextStyle</item>
    </style>

    <style name="MyActionBarTabTextStyle" parent="@android:style/Widget.Holo.Light.Tab">
        <item name="android:textSize">14dip</item>
        <item name="android:padding">0dip</item>
    </style>

</resources>

Is it possible just decrease the font and get rid off those blue lines?

Thanks for help in advance.

P.S.: Also the Button acts weird. The is no text (while it should be)...

7条回答
混吃等死
2楼-- · 2020-02-28 03:08

You can use the setCustomView method.

查看更多
登录 后发表回答