if(VERSION.SDK_INT >= VERSION_CODES.KITKAT) { //4.4以上 //透明状态栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); //透明导航栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); }
原文:http://my.oschina.net/u/1273583/blog/469537