Titanium Alloy - 创建对话框时应用程序如何 运行?
Titanium Alloy - How the application run when dialog created?
我在 Titanium 中有这个代码:
a;
showDialog({
title: L('dialog_title_geo_error'),
message: L("alert_geo_disable")
});
b;
function showDialog(args) {
var dialog = Ti.UI.createAlertDialog(args);
dialog.show();
return dialog;
};
在运行 showDialog() 之后;应用程序的行为是什么?它会停在那里还是继续 运行 b; ?
非常感谢!
基本上,当您只使用 alert() 函数时,应用程序将在后台执行,它不会等待 alert() 函数响应。
但是如果您使用 Ti.UI.createAlertDialog() 和事件侦听器创建警报消息,那么应用程序将等待用户输入的响应。
参考:
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.AlertDialog-property-cancel
在此页面中,示例 1 和示例 2 就像不等待执行,如果您使用示例 3 并根据您的要求使用适当的事件,那么您可以实现它。
我在 Titanium 中有这个代码:
a;
showDialog({
title: L('dialog_title_geo_error'),
message: L("alert_geo_disable")
});
b;
function showDialog(args) {
var dialog = Ti.UI.createAlertDialog(args);
dialog.show();
return dialog;
};
在运行 showDialog() 之后;应用程序的行为是什么?它会停在那里还是继续 运行 b; ? 非常感谢!
基本上,当您只使用 alert() 函数时,应用程序将在后台执行,它不会等待 alert() 函数响应。
但是如果您使用 Ti.UI.createAlertDialog() 和事件侦听器创建警报消息,那么应用程序将等待用户输入的响应。
参考:
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.AlertDialog-property-cancel
在此页面中,示例 1 和示例 2 就像不等待执行,如果您使用示例 3 并根据您的要求使用适当的事件,那么您可以实现它。