1. 状态栏和导航栏
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
// 透明状态栏
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// 透明导航栏
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
</pre><pre name="code" class="java">或者这是theme
<pre name="code" class="java"><style name="FullBleedTheme" parent="android:Theme.Holo.Light.NoActionBar.TranslucentDecor">
<!-- API 19 theme customizations can go here. -->
2 设置状态栏和ActionBar背景一直
private void initSystemBar() {
View view = getWindow().getD
本文介绍了如何在Android应用中实现全屏模式,并处理状态栏和导航栏的显示,包括将状态栏和ActionBar背景设为一致。参考了GitHub上的SystemBarTint库以及SegmentFault上的一篇文章。
订阅专栏 解锁全文
3613

被折叠的 条评论
为什么被折叠?



