I want to remove the divider under the action bar
Asked Answered
S

3

3

What I'm trying to do is exactly as shown in the image" my problem

I want to remove this divider. I'm using the android built-in action bar. I don't want to use Sherlock Action Bar. I have to use android action bar.

I have tried to add this to my styles but its not working

<style name="MyDropDownNav" parent="android:style/Theme.Holo.Light">
    <item name="android:dropDownSelector">@drawable/ic_launcher</item>
    <item name="android:divider">@null</item>
</style>

Do you have any suggestions?

Shoal answered 23/9, 2013 at 2:8 Comment(5)
Is there a reason why? Usually it's not a good idea to try to change Android design practice...Intermediacy
actually yes i want to make the layout under the action bar looks like it's a part of the action barShoal
That's actually pretty cool, I would recommend you using Hierarchy Viewer and seeing what is the actual component that is. What I'm guessing is that it is a padding instead of a divider...Intermediacy
sorry for that what do you mean by Hierarchy Viewer?? is it like the outline and properties i mean is it a tap or a class?Shoal
developer.android.com/tools/help/hierarchy-viewer.htmlIntermediacy
A
6

You can implement a Translucent Action Bar:

Custom Translucent Android ActionBar

Show ImageView partly behind transparent ActionBar

Define themes:

<resources>
<style name="Theme.TranslucentActionBar" parent="@android:style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/Widget.ActionBar</item>
</style>

<style name="Theme.TranslucentActionBar.ActionBar" />

<style name="Theme.TranslucentActionBar.ActionBar.Overlay">
    <item name="android:actionBarStyle">@style/Widget.ActionBar.Transparent</item>
    <item name="android:windowActionBarOverlay">true</item>
</style>
</resources>

and styles for your Action Bar:

<resources>
<style name="Widget.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@drawable/ab_background</item>
</style>

<style name="Widget.ActionBar.Transparent">
    <item name="android:background">@android:color/transparent</item>
</style>
</resources>

Then apply it in your AndroidManifest.xml.

Autumn answered 23/9, 2013 at 2:15 Comment(1)
its worked but for some reason the layout just under the action bar disappeared while the other layouts and views are there i will try to figure it out thanksShoal
E
1
<style name="AppTheme" parent="android:Theme.whatever_theme_you_have">
    ...
    <item name="android:windowContentOverlay">@null</item>
</style>
Enterprise answered 7/10, 2015 at 19:7 Comment(0)
G
0

The divider is contained for actionbar background image.

Try to change actionbar background image. Please refer to below codes.

<style name="AppTheme">
    <item name="android:actionBarStyle">@style/ActionBarStyle</item>
</style>

<style name="ActionBarStyle">
    <item name="android:background">{SET BACKGROUND FOR YOU}</item>
</style>
Glutinous answered 23/9, 2013 at 2:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.