AndroidSystemUiTraining
AndroidSystemUiTraining copied to clipboard
我个人总结,有些文中可能没描述清楚的地方。
1、android:windowTranslucentStatus和android:windowTranslucentNavigation是在api19以上才能使用的,分别是顶部状态栏和底部导航栏。 2、手动设置颜色android:statusBarColor、android:navigationBarColor只有在api21以上能用,而且用了这两个属性必须添加item name="android:windowDrawsSystemBarBackgrounds">true</tem才会生效。 3、所以要在4.4里面实现状态栏颜色和标题栏一样,只需要将android:windowTranslucentStatus设置为true,然后在布局文件中最外层添加android:fitsSystemWindows="true",然后写一个类似Toolbar这样的标题栏就可以了。