android安卓设置dialog全屏的真正有效方法
//在style里面配置了android:windowFullscreen=true无效
//往上相传在构造函数是super下方加setOwnerActivity((Activity)context);也无效
//用下面的函数,生效
@SuppressWarnings(“deprecation”)
public void setFullScrllWidth() {
WindowManager windowManager = (WindowManager) this.getWindow().getWindowManager();
Display display = windowManager.getDefaultDisplay();
WindowManager.LayoutParams lps = this.getWindow().getAttributes();
lps.width = (int) (display.getWidth());
this.getWindow().setAttributes(lps);
}
近期评论