自己總結(jié)的實(shí)現(xiàn)以下效果的幾種方式(需要在values-v19/21配置)
1. 只需要設(shè)置主題屬性纤控,原理是將狀態(tài)欄透明,再利用android:fitsSystemWindows屬性碉纺,可以根據(jù)需要單獨(dú)在控件上設(shè)置該屬性船万。
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
或者(?)
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:fitsSystemWindows">true</item>
</style>
Values:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
values-v19:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
values-v21:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
2. 暫時(shí)沒發(fā)現(xiàn)有更方便的方法骨田。耿导。。
3. 關(guān)于沉浸Immersive
http://www.reibang.com/p/34a8b40b9308
http://blog.csdn.net/sdvch/article/details/44209959