状态栏,导航栏 , ActionBar的格式修改
使状态栏透明:Theme.xml文件中添加
<!--设置状态栏透明-->
<item name="android:windowTranslucentStatus">true</item>
<!--设置无标题栏效果->
<style name="Theme.Test" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!--设置布局中Button 背景颜色为自定义背景色-->
方法1:修改Theme.xml为如下结果
<style name="Theme.Test" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
方法2:layout布局属性中添加如下属性:
android:backgroundTint="@color/black"
设置布局全屏显示: layout属性添加:
android:fitsSystemWindows="true"
前提:状态栏和导航栏都是透明状态;无标题栏