2017-07-11 27 views
-1

我已經使用Android Studio 2.3.3創建了一個應用,選擇空活動模板。創建後,我去了並將背景顏色更改爲colorAccent,並且我還將colorPrimary更改爲colors.xml中的colorAccent。Android應用標頭顯示

現在,當我運行該應用程序時,仿真器顯示出現。

enter image description here

正如你所看到的,它顯示我的應用程序名稱,後面跟着一條暗線。 我不明白這條黑線是從哪裏來的,我該如何擺脫這一點?

但是,這條暗線並未出現在Android Studio設計模式中(請參見下面的截圖)。

enter image description here

+1

其動作條我的朋友的影子 –

+0

看看[Tomer的莫爾(HTTPS的[這](https://stackoverflow.com/a/12246593/6950238)答案://特別是對「更新:」的一部分。 –

+0

是它的動作欄底線 –

回答

1

操作欄我的朋友 刪除此陰影之下行添加到您的主題下RES /價值/風格

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

現在在清單中添加這個陰影將其存檔到您的活動中

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

或者試試這個

getSupportActionBar().setElevation(0); 
+0

我按照你的建議向我的style.xml添加了 @ null,但它仍然顯示陰影。 – Abb

+0

添加你的apptheme我的朋友 –

+0

Nilesh,這裏是我的style.xml。 – Abb