Advertisement
Guest User

Untitled

a guest
Mar 21st, 2012
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Titanium.UI.setBackgroundColor('#000');
  2.  
  3. //creating the window
  4. var win1 = Titanium.UI.createWindow({
  5.     title:'win 1',
  6.     backgroundColor:'#fff'
  7.     });
  8.    
  9.  //add window - navigation bar
  10.  var modalWin = Ti.UI.createWindow();
  11.  
  12.  //nav bar
  13.  var navmodal = Ti.UI.iPhone.createNavigationGroup({
  14.     window:modalWin
  15.  });
  16.  win1.add(navmodal);
  17.  
  18.  //button for the nav bar
  19.  var b2t = Titanium.UI.createButton({
  20.    title:'Launch'
  21. });
  22.  modalWin.RightNavButton = b2t;
  23.  
  24.  //button for the window
  25.  var b1t = Titanium.UI.createButton({
  26.    title:'Launch',
  27.    height:40,
  28.    width:200,
  29.    top:270
  30. });
  31.    
  32.  win1.add(b1t);
  33.  
  34.  //Setting up the documentviewer
  35.  z = Ti.UI.iPad.createDocumentViewer({url:'Example.pdf'});
  36.  
  37.  //documentviewer with animation set on and a quicklook view poping up next to a view
  38.  b1t.addEventListener('click', function()
  39.  {
  40.     z.show({animated:false,view:b2t});
  41.  });
  42.  
  43.  //documentviewer with animation set off
  44.  b2t.addEventListener('click', function()
  45.  {
  46.     z.show();
  47.  });
  48.  
  49.  win1.open();
  50.  
  51. var interval = setInterval(function()
  52. {
  53.     z.hide();
  54.     Ti.API.info('z has been closed');
  55.    
  56.     clearInterval(interval);
  57. }, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement