scrollableView - Current View

You must Login before you can answer or comment on any questions.

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();
});

— asked 1 year ago by Nick Kobo
0 Comments

2 Answers

Accepted Answer

hi,

you can also open with animation

w.open({
    transition : Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
});

— answered 1 year ago by Mitul Bhalia
answer permalink
2 Comments
  • ok, got it your point

    just set currentpage in global vaiarble like

    var cPage = 0;
    scrollableView.addEventListener('scroll',function(e){
        cPage = e.currentPage;
    });
     
    var w = Titanium.UI.createWindow({
        url:'info'+cPage+'.js', ////here is the info button///////
        top:0,
     bottom:0,
     width:768 
        });

    — commented 1 year ago by Mitul Bhalia

  • Yeah MItul is right, sorry I did'nt get your problem

    — commented 1 year ago by Jb Gartner

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!