Search code examples
androidandroid-actionbar

Removing line or divider between action bar and main screen in Android


How can I remove line or divider between action bar and main screen? How can I change the color of this divider in android? Thanks in advance.


Solution

  • After more effort I can find my ideal Theme.

    1. First of all i must say that Theme.Holo.Light has a shadow in bottom of action bar if you want to have not that shadow you must use Theme.Holo.
    2. After you change the style you must change other settings for yourself like the code.

      <resources>
          <style name="AppTheme" parent="android:Theme.Holo">
              <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
              <item name="android:background">#ff0000</item>
              <item name="android:colorBackground">#ff0000</item>
          </style>
          <style name="AppTheme.ActionBar" parent="android:Widget.ActionBar">
              <item name="android:background">#ff0000</item>
          </style>
      </resources>
      
    3. This below code is for my last challange that I found how to resolve it.

      <resources>
          <style name="AppTheme" parent="android:Theme.Holo.Light">
              <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
              <item name="android:background">#ff0000</item>
              <item name="android:colorBackground">#ff0000</item>
          </style>
          <style name="AppTheme.ActionBar" parent="android:Widget.ActionBar">
              <item name="android:background">#ff0000</item>
          </style>
      </resources>
      
    4. Below Image is for first Code, If you notice there isn't any divider.

    enter image description here

    1. And below Image is for second Code.

    enter image description here