Hi all
How to open specific window for the current view when then user press the info button?
var view1 = Ti.UI.createView({ backgroundImage:'images/1.jpg' }); var view2 = Ti.UI.createView({ backgroundImage:'images/2.jpg' }); var view3 = Ti.UI.createView({ backgroundImage:'images/3.jpg' }); var data var scrollableView = Ti.UI.createScrollableView({ top:40, bottom:100, views:[view1,view2,view3], showPagingControl:false, currentPage:0 }); win.add(scrollableView); win.open(); var info = Ti.UI.createButton({ backgroundImage:'info.png', top:700, right:20, width:30, height:30 }); win.add(info); info.addEventListener('singletap', function() { var w = Titanium.UI.createWindow({ url:'info'+e.currentPage+'.js', ////here is the info button/////// top:0, bottom:0, width:768 }); var b = Titanium.UI.createButton({ title:"Close", backgroundImage:"bg.png", color:"#767d83", bottom:50, right:40, height:50, width:123, font:{fontSize:14 } }); w.add(b); b.addEventListener('click', function() { w.close(); }); w.open(); });
2 Answers
Accepted Answer
hi,
you can also open with animation
w.open({ transition : Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT });
Usually when you want to show an info page, you open the window this way :
w.open({modal:true});I don't think top, bottom and width args are necessary
Your Answer
Think you can help? Login to answer this question!