Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

ScrollViews and touchmove events...

Hey guys,

I'm building an application where users can move images around and resize them. To do this, I've got an ImageView inside of a ScrollView. When it was just an ImageView, my touchmove event to center it worked fine. Now that it's inside of a ScrollView, it moves slightly, then nothing.

Any ideas what I'm doing wrong? Could the ScrollView's auto content sizing be causing problems or something?

Any advice on moving a ScrollView around would be appreciated. Thanks guys.

— asked April 18th 2010 by Jonathan Barket
  • imageview
  • mobile
  • scrollview
  • touchmove
0 Comments

6 Answers

  • sounds like you're doing something similar to me.
    and scrollview was my first thought for being able to resize images.

    so yes, +1. hopefully someone has an answer :)

    — answered April 19th 2010 by Steve Burtenshaw
    permalink
    0 Comments
  • Why are you using the scroll view - is this so that you can move beyond the bounds of the screen?

    The problem is that image view and scroll view will fight each other for the touch events.

    We should be able to come up with another way of doing this if i understand the use case a little more detail.

    — answered May 29th 2010 by Jeff Haynie
    permalink
    0 Comments
  • I don't know the best way to handle image scaling on ipod or ipad. However, on android if you toss out the scrollview and use imageView alone with the "canScale" option set to true. You get a image that can zoom and pan/tilt. You can also use it inside any view just not ones that scroll.

    var imageView = Titanium.UI.createImageView({        
            image:'loading.png',
            width:'auto',
            height:'auto',
            canScale:true
    
            });
    
    — answered July 19th 2010 by Brett G
    permalink
    0 Comments
  • I don't know the best way to handle image scaling on ipod or ipad. However, on android if you toss out the scrollview and use imageView alone with the "canScale" option set to true. You get a image that can zoom and pan/tilt. You can also use it inside any view just not ones that scroll.

    var imageView = Titanium.UI.createImageView({        
            image:'loading.png',
            width:'auto',
            height:'auto',
            canScale:true
    
            });
    
    — answered July 19th 2010 by Brett G
    permalink
    1 Comment
    • sorry for the double post.

      — commented July 19th 2010 by Brett G
  • I know it's been over a year, but is there any solution to this? I am stuck with the same problem.

    — answered December 29th 2011 by Sofian Wijaya
    permalink
    0 Comments
  • You will never have an answer. I have same problem, it's just Titanium's bug, I don't believe they going to fix this

    — answered May 29th 2010 by Vitali Virulaine
    permalink
    2 Comments
    • It's not a titanium bug. Both views are going to fight for the same event.

      — commented May 29th 2010 by Jeff Haynie
    • Then what is the solution? do not use scrollview and imageView together? if you want to zoom the image in imageView

      — commented January 3rd 2011 by mohammad taleb
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.