Titanium Community Questions & Answer Archive

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

scrollableView does not pan if views contents are wider than screen width

To show jpegs showing a double-page catalog, I created a scrollableview with views containing images that I need to show as high as the available screen height.
As a consequence the views width oversizes the screen available width.

When I try to move right and left the views (panning) the scrollableView gets scrolled instead, and does not reach the end of the view.
If I try to scale the views up and down (pinching), the views then pan as one would expect, scrolling only after reaching the end of the view.
This is more or less how my code looks like:

var win = Titanium.UI.currentWindow;
var pageviews=[];
for(var n;n<numimages;++n) {
    pageviews[n] = Ti.UI.createImageView({
        top: 0,
        left: 0,
        backgroundImage: "... reference to image with size 1446x1024px",
        image: null,
        height: win.size.height,
        width: 537 // calculated 
var scrollView = Titanium.UI.createScrollableView({
    views: pageviews,

Is this sort of wrong behavior of the scrollableView class?
And, by the way, why the scale event is not catchable like it is using the scrollView class, nor is the scale factor settable?

Thanks for your suggestions on how to solve my problem.

— asked December 3rd 2010 by MAURIZIO SILIANI
  • scrollableview
1 Comment
  • When you post a question, please always state your mobile platform and Titanium SDK. The easiest way is simply to include this information in the question tags.

    — commented December 3rd 2010 by Paul Dowsett

0 Answers

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.