Search code examples
androidtitanium

Titanium: navigation from one screen to other


On the click of my button, I want to navigate to another screen. How would I achieve this in Titanium?

var TrialButton = Titanium.UI.createButton({
    color:'black',
    backgroundColor:'#FFFFFF',
    title:'Trial Mode',
    top:55,
    width:300,
    height:50,
    borderRadius:5,
    font:{fontSize:18, fontFamily :'Helvetica', fontWeight:'bold'}
});



 TrialButton.addEventListener('click', function() {    
  var newWindow = Titanium.UI.createWindow({ 
      background : "#fff",
      title : "Trial Demo",           
      url:"nextScreen.js"    
  });    
  newWindow.open();              
});

Solution

  •  TrialButton.addEventListener('click', function()
     {
        var newWindow = Ti.UI.createWindow({
            background : "#000",
            title : "Image View",
            url:"nextScreen.js"
        });
        newWindow.open();             
     )};
    

    should checkout examples here https://github.com/appcelerator/KitchenSink

    here are some posts from my blog http://blog.clearlyinnovative.com/tagged/Appcelerator