2011-08-04 6 views
0

Appcelerator에서 iOS 앱을 개발 중이며 스 와이프 이벤트 리스너를 사용하여 창 사이를 전환하고 싶습니다. 어떻게해야합니까? 아래 코드는 작동하지 않습니다. 내가 "시작"하는 현재 윈도우에는 테이블이 있습니다.Appcelerator. 스 와이프를 사용하여 창 열기

var window = Ti.UI.currentWindow; 

window.addEventListener('swipe', function() { 

    // Create the new window 

    var win = Titanium.UI.createWindow({ 

     title: 'Contacts', 
     url:'contacts_simple.js' 

    }); 

    // Animate the page turn 

    Titanium.UI.currentTab.open(win, {animated:false}); 

}); 

답변

0

저는이 문제가 Ti.UI.currentWindow에 있다고 생각합니다. 작업중인 컨텍스트에 따라 유효하지 않을 수 있습니다.
http://developer.appcelerator.com/question/5391/currentwindow

이 최적의 동적 수 없지만, 시작 암시 창을 참조 시도 :

구글 appcelerator의 currentWindow ', 그러나 여기에는 관련 링크입니다. 당신이 시도

var window_x = Ti.UI.createWindow({}); 

뭔가를 한 경우에 의미

window_x.addEventListener('swipe', function() {...}); 
관련 문제