Guest User

Untitled

a guest
Feb 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var scrollView = Titanium.UI.createScrollView({
  2. contentWidth:'auto',
  3. contentHeight:'auto',
  4. top:0,
  5. showVerticalScrollIndicator:true,
  6. showHorizontalScrollIndicator:true,
  7. zoomScale:1
  8. });
  9.  
  10. var view = Titanium.UI.createImageView({
  11. image:'zebra.jpg',
  12. width:'auto',
  13. height:'auto'
  14. });
  15. var x=0;
  16.  
  17. function zoom(){
  18. if(x==1){
  19. view.animate({width:view.width/2, height:view.height/2});
  20. x=0;
  21. }
  22. else{
  23. view.animate({width:view.width*2, height:view.height*2});
  24. x=1;
  25. }
  26. }
  27. view.addEventListener('doubletap',zoom);
  28. scrollView.add(view);
  29. win1.add(scrollView);
Add Comment
Please, Sign In to add comment