这篇文章将为大家详细讲解有关在Android应用中如何释放空间,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。
在网上搜索找到两种方法:
if (Build.VERSION.SDK_INT >= 19){ WindowManager.LayoutParams localLayoutParams = mActivity.getWindow().getAttributes(); localLayoutParams.flags = (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | localLayoutParams.flags); if (fmMain != null) { //fmMain:自定义的顶部导航条 LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) fmMain.getLayoutParams(); layoutParams.setMargins(0, ChuangChuangApp.STATUSBARHEIGHT, 0, 0);//STATUSBARHEIGHT状态栏高度 fmMain.setLayoutParams(layoutParams); //设置顶部margin值 } }