Android应用标头广告显示 [英] Android app masthead display
问题描述
我使用Android Studio 2.3.3创建了一个应用,选择空活动模板".创建它之后,我去了将背景色更改为诸如colorAccent之类的东西,并且还在colors.xml中将colorPrimary更改为colorAccent.
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.
如您所见,它显示我的应用程序名称,后跟黑线. 我不明白这条黑线是从哪里来的,我该如何摆脱呢?
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?
但是,这条黑线在Android Studio设计模式下不会出现(请参见下面的屏幕截图).
However, this dark line does not appear in Android Studio design mode (see screenshot below).
推荐答案
这是操作栏的阴影,我的朋友 要删除此阴影,请在 res/values/style
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"/>
或尝试
getSupportActionBar().setElevation(0);
这篇关于Android应用标头广告显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!