我想通过添加使状态栏透明<item name="android:statusBarColor">@android:color/transparent</item>
到 v21/styles.xml 上style name="AppTheme.NoActionBar"
但我的应用栏上方总是出现阴影,是否可以将其删除?
编辑:
好的,我认为解决方案是移动占据状态栏空间的应用程序栏,并扩展附加 dp 的应用程序栏以匹配其大小,所以我的问题是,是否可以向上移动或扩展应用程序栏高度?
活动搜索.xml
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/MyMaterialTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
app:popupTheme="@style/MyMaterialTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_search"/>
我相信这个问题指向同样的问题Android appbarlayout 海拔出现在状态栏中 https://stackoverflow.com/questions/33726318/android-appbarlayout-elevation-appears-in-status-bar
可能的解决方案:
你的根布局应该有android:fitsSystemWindows="true"
始终如此,否则您的 UI 将不会在状态栏后面绘制。
现在把AppBarLayout
在另一个里面CoordinatorLayout
其中有
android:fitsSystemWindows="false"
.
这将防止阴影溢出到状态栏。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)