且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

后退按钮使用 appcelerator 钛退出 android 中的应用程序

更新时间:2023-01-10 11:54:14

有两种类型的窗口,例如,轻量级和重量级.如果您在 Titanium android 中创建一个轻量级窗口而不是按后退按钮,它将存在于您的应用程序中.

There are two types of windows like, lightweight and heavyweight. If you create a lightweight window in Titanium android than on back button press it will exist from your application.

您可以通过创建重量级窗口来实现您想要的.您可以通过将其作为模式窗口打开来在钛中创建重量级窗口.所以在新建窗口的时候把参数modal:true新窗口将创建为模态窗口(钛 android 的重量级窗口).然后,如果您按下后退按钮,它将不会退出应用程序.

You can achieve what you want by creating heavyweight window. You can create heavyweight window in titanium by open it as modal window. So put the parameter modal:true when you create a new window. New window will be created as modal window (heavyweight window for titanium android). And then after if you will press back button it will not exit from application.