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?

n00begon
  • 3,503
  • 3
  • 29
  • 42
Yamen Nassif
  • 2,416
  • 2
  • 24
  • 48
  • Is there a reason why? Usually it's not a good idea to try to change Android design practice... – Ryan S Sep 23 '13 at 02:10
  • 2
    actually yes i want to make the layout under the action bar looks like it's a part of the action bar – Yamen Nassif Sep 23 '13 at 02:12
  • 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... – Ryan S Sep 23 '13 at 02:14
  • 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? – Yamen Nassif Sep 23 '13 at 02:17
  • 1
    http://developer.android.com/tools/help/hierarchy-viewer.html – Ryan S Sep 23 '13 at 02:24

3 Answers3

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.

Community
  • 1
  • 1
mmBs
  • 8,421
  • 6
  • 38
  • 46
  • 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 thanks – Yamen Nassif Sep 23 '13 at 02:29
1
<style name="AppTheme" parent="android:Theme.whatever_theme_you_have">
    ...
    <item name="android:windowContentOverlay">@null</item>
</style>
Andrew
  • 36,676
  • 11
  • 141
  • 113
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>
Seungmin Ha
  • 151
  • 1
  • 5