Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. var win = Ti.UI.createWindow({});
  2. var view = Ti.UI.createView({});
  3.  
  4. var button = Ti.UI.createButton({
  5. color : '#000000',
  6. title : "Add photo",
  7. height : 'auto',
  8. width : 'auto'
  9. });
  10. view.add(button);
  11.  
  12. button.addEventListener('click', function(e) {
  13. showCamera();
  14. });
  15.  
  16. function showCamera() {
  17. Titanium.Media.showCamera({
  18. showControls : true,
  19. mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
  20. autorotate : true,
  21. success : function(event) {
  22. },
  23. error : function(error) {
  24. },
  25. cancel : function() {
  26. }
  27. });
  28. }
  29.  
  30. win.add(view);
  31. win.open();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement