Guest User

Untitled

a guest
Oct 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1.  
  2. Titanium.UI.setBackgroundColor('#000');
  3.  
  4. // create tab group
  5. var tabGroup = Titanium.UI.createTabGroup();
  6.  
  7. var win = Titanium.UI.createWindow({
  8. title:'Tab 1',
  9. backgroundColor:'#fff'
  10. });
  11. var tab1 = Titanium.UI.createTab({
  12. icon:'KS_nav_views.png',
  13. title:'Tab 1',
  14. window:win
  15. });
  16.  
  17.  
  18. var view = Titanium.UI.createImageView({
  19. height:43,
  20. width:98,
  21. top:10,
  22. image:'closewin.png', //image file
  23. transform:Ti.UI.create3DMatrix().rotate(180, 0, 1, 0)
  24. });
  25. win.add(view);
  26.  
  27. var save = Titanium.UI.createButton({
  28. title:'Save',
  29. width:120,
  30. height:40,
  31. bottom:20,
  32. right:0,
  33. });
  34.  
  35. save.addEventListener('click', function()
  36. {
  37. // file system
  38. var photoname= new Date().getTime()+".png";
  39. var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,photoname);
  40. f.write(view.toImage());
  41.  
  42. });
  43. win.add(save);
  44.  
  45. tabGroup.addTab(tab1);
  46. tabGroup.open();
Add Comment
Please, Sign In to add comment