Skip to content

Instantly share code, notes, and snippets.

@srahim
Created December 7, 2011 00:05
Show Gist options
  • Save srahim/1440723 to your computer and use it in GitHub Desktop.
Save srahim/1440723 to your computer and use it in GitHub Desktop.
example
Titanium.UI.setBackgroundColor('#000');
//creating the window
var win1 = Titanium.UI.createWindow({
title:'win 1',
backgroundColor:'#fff'
});
//add window - navigation bar
var modalWin = Ti.UI.createWindow();
//nav bar
var navmodal = Ti.UI.iPhone.createNavigationGroup({
window:modalWin
});
win1.add(navmodal);
//button for the nav bar
var b2t = Titanium.UI.createButton({
title:'Launch'
});
modalWin.RightNavButton = b2t;
//button for the window
var b1t = Titanium.UI.createButton({
title:'Launch',
height:40,
width:200,
top:270
});
win1.add(b1t);
//Setting up the documentviewer
z = Ti.UI.iPad.createDocumentViewer({url:'Example.pdf'});
//documentviewer with animation set on and a quicklook view poping up next to a view
b1t.addEventListener('click', function(){z.show({animated:false,view:b2t});});
//documentviewer with animation set off
b2t.addEventListener('click', function(){z.show();});
win1.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment