android状态栏怎么设置透明
1、在Style.xml文件中设置:<item name="android:windowTranslucentStatus">true</item> //透明的状态栏 <item name="android:windowTranslucentNavigation">true</item>//透明的导航图 <item name="android:fitsSystemWindows">true</item>//设置应用布局时是否考虑系统窗口布局

3、使用代码设置(判断当前SDK是否大于19,推荐使用代码设置)//判断SDK版本是否大于等于4.4 因为该属性只有19版本才能设置if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) { WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes(); localLayoutParams.flags = (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | localLayoutParams.flags);}

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:71
阅读量:54
阅读量:33
阅读量:49
阅读量:41