Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. var win1 = Titanium.UI.createWindow({
  2. title : 'Tab 1',
  3. backgroundColor : '#ccc'
  4. });
  5.  
  6. // Create a Button.
  7. var aButton = Ti.UI.createButton({
  8. title : 'aButton',
  9. height : Ti.UI.SIZE,
  10. width : Ti.UI.SIZE,
  11.  
  12. });
  13.  
  14. // Listen for click events.
  15. aButton.addEventListener('click', function() {
  16. var alertDialog = Titanium.UI.createAlertDialog({
  17. message : 'MESSAGE',
  18. buttonNames : ["OK", "Cancel"],
  19. persistent : false,
  20. canceledOnTouchOutside : false,
  21.  
  22. });
  23. alertDialog.show();
  24.  
  25. });
  26.  
  27. // Add to the parent view.
  28. win1.add(aButton);
  29.  
  30. win1.open();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement