Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. APP.JS
  2.  
  3. setTimeout(function(){
  4. 'use strict';
  5. var StartUp;
  6.  
  7. StartUp = require('control/startup');
  8. StartUp.StartApp();
  9. }, 2000);
  10.  
  11.  
  12.  
  13.  
  14. STARTUP.JS
  15.  
  16. function StartApp(){
  17. 'use strict';
  18.  
  19. var MainWin;
  20. var greenSquare;
  21. var redSquare;
  22.  
  23. MainWin = Titanium.UI.createWindow({
  24. backgroundColor: '#ccc',
  25. width:'100%',
  26. height:'100%',
  27. top:0
  28. });
  29.  
  30. greenSquare = Titanium.UI.createView({
  31. borderRadius:10,
  32. backgroundColor:'green',
  33. width:50,
  34. height:50,
  35. left:50,
  36. top:50
  37. });
  38. redSquare = Titanium.UI.createView({
  39. borderRadius:10,
  40. backgroundColor:'red',
  41. width:50,
  42. height:50,
  43. left:greenSquare.left+50,
  44. top:200
  45. });
  46.  
  47. MainWin.add(greenSquare);
  48. MainWin.add(redSquare);
  49.  
  50. MainWin.open();
  51. }
  52. exports.StartApp = StartApp;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement