【发布时间】:2017-10-23 12:05:58
【问题描述】:
我注意到很多带有透明工具栏且没有高度的材料设计应用程序。
我已经设法通过将background 属性添加到AppBarLayout 来使我自己的工具栏透明,但是我无法通过更改高度属性来移除阴影。
知道如何移除高程,还是让 AppCompat 工具栏通常透明的更好方法?谢谢。
这是我的 AppBar
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="@android:color/transparent"
android:elevation="0dp"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
</android.support.design.widget.AppBarLayout>
编辑
将android:elevation 更改为app:elevation 只会使工具栏完全消失
【问题讨论】:
标签: android