AlertDialog获取Button,点击外围不消失,设置样式
来源:互联网 发布:燕郊淘宝店招聘 编辑:程序博客网 时间:2024/06/06 23:19
private AlertDialog AlertDialogShow(String message){ AlertDialog.Builder builder = new AlertDialog.Builder(OutScaner3Activity.this, android.R.style.Theme_Holo_Light_Dialog). setTitle("提示").setMessage(message). setNegativeButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }).setPositiveButton("取消", null); AlertDialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); //点击AlertDialog外面的位置,AlertDialog不消失, //设置背景样式 dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent); dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); dialog.show(); //注意放在dialog.show();的后面 dialog.getButton(DialogInterface.BUTTON_POSITIVE).setFocusable(false); //获取button dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setFocusable(false); //获取button return dialog;}
阅读全文
0 0
- AlertDialog获取Button,点击外围不消失,设置样式
- android AlertDialog设置点击button不退出
- AlertDialog点击按钮不消失
- Alertdialog对话框,设置点击其他位置不消失
- Android--Alertdialog对话框,设置点击其他位置不消失
- Alertdialog对话框,设置点击其他位置不消失
- AlertDialog点击按钮后不消失
- Diaolog 响应back键,而不响应 外围点击,消失
- Android4.0的Alertdialog对话框,设置点击其他位置不消失
- Android4.0的Alertdialog对话框,设置点击其他位置不消失
- Android4.0的Alertdialog对话框,设置点击其他位置不消失
- Android4.0的Alertdialog对话框,设置点击其他位置不消失
- Android4.0的Alertdialog对话框,设置点击其他位置不消失
- android AlertDialog.Builder 设置对话框不消失
- 让AlertDialog在点击按钮后不消失、不关闭
- 让AlertDialog在点击按钮后不消失、不关闭
- 拦截AlertDialog点击消失
- android alertdialog的按钮点击后不消失
- Hive学习笔记 --- Hive导出数据为文本
- 常用rxjava操作符
- ccui.TextAtlas
- 限制访问Web资源
- Sprak RDD缓存
- AlertDialog获取Button,点击外围不消失,设置样式
- 折腾gcc/g++链接时.o文件及库的顺序问题
- Spring Security(05)——异常信息本地化(国际化)
- Redis在Windows下安装配置
- Tomcat8配置优化
- PHPWord 打印word文档[可带图片,相对定位等]
- git学习笔记 -- day03 远程仓库、Linux安装私服
- android 关闭硬件加速
- 软件工程(C语言实践篇)课程总结