Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
141 views
Welcome To Ask or Share your Answers For Others

1 Answer

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...