Titanium 如何获得当前打开的钛合金窗口?
我想获取当前打开的窗口对象。 比如在demo.js中Titanium 如何获得当前打开的钛合金窗口?,titanium,appcelerator,titanium-mobile,titanium-alloy,Titanium,Appcelerator,Titanium Mobile,Titanium Alloy,我想获取当前打开的窗口对象。 比如在demo.js中 console.info("=====current_window=====") console.info(Ti.UI.currentWindow) console.info(Ti.UI.getCurrentWindow()) 我希望它是输出:demo或$.demo(如果我没有在这个窗口上给出Id) 但我明白了: [INFO] [iphone, 8.2, 192.168.1.112] =====current_window===== [IN
console.info("=====current_window=====")
console.info(Ti.UI.currentWindow)
console.info(Ti.UI.getCurrentWindow())
我希望它是输出:demo或$.demo(如果我没有在这个窗口上给出Id)
但我明白了:
[INFO] [iphone, 8.2, 192.168.1.112] =====current_window=====
[INFO] [iphone, 8.2, 192.168.1.112]
[INFO] [iphone, 8.2, 192.168.1.112]
有什么建议吗?如上面所说:
此属性仅在使用Titanium.UI.Window.url属性在各自的上下文中加载JavaScript文件时可用
此属性从3.6.0/4.0.0开始使用,并已被长期弃用
您应该使用CommonJS(require()
-notTi.include()
)来组织上下文并自己跟踪当前打开的窗口,具体取决于您管理窗口的方式。如所述:
此属性仅在使用Titanium.UI.Window.url属性在各自的上下文中加载JavaScript文件时可用
此属性从3.6.0/4.0.0开始使用,并已被长期弃用
您应该使用CommonJS(require()
-notTi.include()
)来组织上下文并自己跟踪当前打开的窗口,具体取决于您管理窗口的方式