Chinaunix首页 | 论坛 | 博客
  • 博客访问: 248473
  • 博文数量: 49
  • 博客积分: 110
  • 博客等级: 民兵
  • 技术积分: 510
  • 用 户 组: 普通用户
  • 注册时间: 2013-01-13 00:59
个人简介

make it run,make it better,make it fast. https://github.com/liulanghaitun

文章分类

全部博文(49)

文章存档

2023年(1)

2022年(2)

2020年(4)

2019年(4)

2017年(15)

2016年(3)

2014年(3)

2013年(14)

分类: Android平台

2022-03-06 23:55:02


点击(此处)折叠或打开

  1. AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
  2.             LayoutInflater inflater = ((Activity)context).getLayoutInflater();
  3.             dialogBuilder.setView(inflater.inflate(R.layout.dialog_signin, null));
  4.             dialogBuilder.setCancelable(false);
  5.             AlertDialog alertDialog = dialogBuilder.create();

  6.             if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O){
  7.                 WindowManager.LayoutParams params = new WindowManager.LayoutParams();
  8.                 params.type = WindowManager.LayoutParams.TYPE_PHONE;
  9.                 alertDialog.onWindowAttributesChanged(params);
  10.             }else {
  11.                 WindowManager.LayoutParams params = new WindowManager.LayoutParams();
  12.                 params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
  13.                 alertDialog.onWindowAttributesChanged(params);
  14.             }
  15.             alertDialog.show();

阅读(1800) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~