Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3114] iPad: Scroll View in 3.2 Causes Scrollable View to Malfunction

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-26T16:45:20.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sn/a
ComponentsiOS
Labelsdefect, ios, ios3.2, ipad, rplist
ReporterDawson Toth
AssigneeNeeraj Gupta
Created2011-04-15T03:37:17.000+0000
Updated2012-07-26T20:22:15.000+0000

Description

Problem

Assume I have a scroll view inside of a scrollable view. If the scroll view's content is not taller than the scroll view, on iOS 3.2 the scrollable view will not be able to change pages (horizontally dragging your finger does nothing). On iOS 4 and later, everything works as expected (horizontally dragging your finger changes the page).

Tested On

Titanium SDK version: 1.6.0 (02/10/11 14:34 9db0685...)
BROKEN in iPad Simulator 3.2
WORKS in iPad Simulator 4.2

Sample Code

This code has a scrollable view with three scroll views of varying content heights. The first is taller, the second is equal, and the third is shorter. The end result is you can swipe from the first to the second, but if you let the scrollable settle (don't touch it for several seconds), you will be stuck.

var window = Titanium.UI.createWindow({
    backgroundColor:'#fff'
});

var scrollViewHeights = [window.height + 1, window.height, window.height - 1];

window.add(Ti.UI.createLabel({
    top: 0, left: 0, height: 30,
    text: 'This is scrollable view, but it will get stuck on the second page on iOS 3.2 (if you let it settle).'
}));

var views = [];
for (var i = 0; i < 3; i++) {
    var scrollView = Ti.UI.createScrollView({
        top: 0, left: 0, right: 0, bottom: 0,
        contentHeight: 'auto'
    });
    scrollView.add(Ti.UI.createImageView({
        top: 0, left: 0, right: 0,
        height: scrollViewHeights[i],
        image: 'default_app_logo.png'
    }));
    views.push(scrollView);
}

window.add(Ti.UI.createScrollableView({
    top: 0, right: 0, bottom: 0, left: 0,
    views: views
}));

window.add(Ti.UI.createLabel({
    bottom: 0, left: 0, height: 30,
    text: 'This is caused by the scroll view; if its content isn\'t tall enough to scroll, it prevents 3.2 touch events.'
}));

window.open();

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/71641">http://developer.appcelerator.com/helpdesk/view/71641

Comments

  1. Dawson Toth 2011-04-15

    Workaround

    Make sure that any scroll view inside of a scrollable view has a contentHeight taller than the view itself.

  2. Stephen Tramer 2012-07-26

    Cannot observe described behavior on SDK 2.2.0.014b86f, iPhone Sim 5.1.

JSON Source