简体   繁体   中英

Android - Customize the Action Bar

I need to customize my Action Bar by changing color, substitute the default icons (settings and the "back" arrow) with custom images, and remove the Action Bar title with a custom font placed at the center of the Action Bar.

How can I apply these changes?

I already tried to change the background color of the Action Bar but it doesn't work, can you tell me why please?

<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/aBbG</item>
</style>

<style name="aBbG" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">#b10600</item>
</style>

Very thanks in advance!

I suggest you this way :

I suggest a way to you below , you can do like that( it is just one way I think)

  • Hide your actionbar. like this : actionBar.hide();
  • then create linearlayout and put it in your main activty which calls your fragments
  • then you can customize your layout as you needs.

I do it as I said. You can see the screenshot below:(it is not actionbar it is linearlayout)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM