赞
踩
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
不需要时:
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
mManager = (WindowManager) getSystemService(WINDOW_SERVICE);mWindowView = View . inflate ( this , R . layout . window_layout , null );//设置固定高度才显示 mParams = new WindowManager.LayoutParams(); mParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;mParams.height = WindowManager.LayoutParams.MATCH_PARENT; mParams.width = WindowManager.LayoutParams.MATCH_PARENT; mParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_SECURE;mParams . format = PixelFormat . TRANSLUCENT ;mManager.addView(mWindowView, mParams); //给window添加View时注意复用..
mManager.removeView(mWindowView);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。