【问题标题】:Hiding elevation of AppBar隐藏 AppBar 的高度
【发布时间】:2018-07-28 18:06:07
【问题描述】:
我正在尝试模拟一个大型 AppBar,它正在为其添加一些额外的布局。
为此,我在 AppBar 正下方放置了一个布局,并为其分配了相同的颜色,但我得到了高程阴影,正如您在这张图片中看到的那样:
我尝试为我的布局配置 4dp 高度(我也尝试使用 8dp)以避免阴影,但它并没有消失。
我怎样才能让那个阴影去模拟一个大的 AppBar?
【问题讨论】:
标签:
android
android-actionbar
material-design
android-toolbar
【解决方案2】:
在布局的 xml 文件中,如果您添加 AppBarLayout 标签,您可以定义高程并将其设置为 0dp
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:elevation="0dp"></android.support.design.widget.AppBarLayout>