我正在开发一个安卓应用程序,我试图删除AppBar下的阴影,我尝试使用android:elevation="0dp",但它对我无效,我尝试了<item name="android:windowContentOverlay">@null</item>的样式,但它也不起作用,下面是我的代码:
Styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="MyCheckBox" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">#005cb8</item>
<item name="colorControlActivated">#005cb8</item>
</style>
</resources>activity_bienvenu.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:fitsSystemWindows="true"
tools:context="molfix.dev.molfix.Activities.Bvn.BienvenuActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp"
android:background="#91d0f0">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@drawable/toolbar_bienvenu"
android:scrollbars="none"
android:weightSum="1"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</RelativeLayout>我使用api 25作为目标,最低限度使用19,有帮助吗?
发布于 2017-08-04 00:48:43
我找到了答案,我要做的就是用这个:
app:elevation="0dp"https://stackoverflow.com/questions/45496316
复制相似问题