android 4.0 对话框在对话框窗口外触摸时被取消 [英] android 4.0 Dialog gets canceled when touched outside of dialog window

查看:25
本文介绍了android 4.0 对话框在对话框窗口外触摸时被取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在 dialog 窗口外单击时,我遇到了 ICS 上的问题,例如 dialog is dismissed,因此我遇到了问题就像我没有得到用户的任何确认一样.

Hi I am facing the problem on ICS like dialog is dismissed when we click outside dialog window, due to which I am getting problem like I don't get any confirmation from user.

请帮忙.

推荐答案

检查 此方法 来自 Android 开发人员站点的对话框.

Check this method from the Android Developers site for dialog.

尝试使用

dialog.setCanceledOnTouchOutside(布尔值取消)

传递一个布尔值以启用/禁用在对话框窗口外触摸时的对话框行为.

Pass a boolean value to enable/disable dialog behaviour when touched outside of the dialog window.

还可以通过这些链接:

如何在对话框外发生点击时触发事件

如何取消在窗口外触摸时以 Activity 为主题的对话框?

我希望这能回答您的问题.

I hope this answers your question.

这篇关于android 4.0 对话框在对话框窗口外触摸时被取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆