-1

I have created an app using Android Studio 2.3.3, choosing Empty Activity Template. After its creation I went and changed the background color to something like colorAccent and I also changed the colorPrimary to colorAccent in colors.xml.

Now, when I ran the app, following emulator display appeared.

enter image description here

As you can see, it displays my app name, followed by a dark line. I don't understand where this dark line has come from and how can I get rid of this?

However, this dark line does not appear in Android Studio design mode (see screenshot below).

enter image description here

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Abhijeet
  • 49
  • 10

1 Answers1

1

it is shadow of action bar my friend to remove this shadow add below lines to your theme under res/values/style

<style name="MYTheme" parent="android:Theme.Holo.Light">
    <item name="colorPrimary">@color/colorWhite</item>
    <item name="colorPrimaryDark">@color/colorWhite</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowContentOverlay">@null</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

now add this in manifest file this to your activity

<activity
android:name=".YourActivity"
android:theme="@style/MYTheme"/>

or try this

    getSupportActionBar().setElevation(0);
AskNilesh
  • 67,701
  • 16
  • 123
  • 163