4.0的對話框與2.X,3.X有不一樣之處,它會在對話框外任意點擊就會自動消失,
解決兩種:
| void |
setCancelable(boolean flag)
Sets whether this dialog is cancelable with the
BACK key.
|
| void |
setCanceledOnTouchOutside(boolean cancel)
Sets whether this dialog is canceled when touched outside the window's bounds.
|
本文介绍4.0版本对话框与之前版本的不同之处,着重讲解如何通过两种方法设置对话框是否能在点击窗口边界外区域时被取消,包括使用`setCancelable`和`setCanceledOnTouchOutside`。
5560

被折叠的 条评论
为什么被折叠?



