Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3206] Rotating device in the middle of view scroll causes odd behavior

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-05-11T18:27:09.000+0000
Affected Version/sn/a
Fix Version/sSprint-2011-08
ComponentsiOS
Labelsios, rotation, rplist, scrollableview
ReporterStephen Tramer
AssigneeStephen Tramer
Created2011-04-15T03:39:27.000+0000
Updated2011-05-11T18:27:09.000+0000

Description

Stops in the middle of the scroll, and then doesn't re-center on the view that was being scrolled to. We need to take rotation into account on scrollable view to prevent issues like this. Can be seen in the following code sample:

var win = Titanium.UI.createWindow({backgroundColor:'white'});
win.orientationModes = [
    Titanium.UI.PORTRAIT,
    Titanium.UI.UPSIDE_PORTRAIT,
    Titanium.UI.LANDSCAPE_LEFT,
    Titanium.UI.LANDSCAPE_RIGHT,
    Titanium.UI.FACE_UP,
    Titanium.UI.FACE_DOWN
]; 
var views = [];

for(var i = 0; i < 25; i++) {
    views.push(Ti.UI.createWebView({
        html: '<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>',
        left: 20,
        right: 20,
        backgroundColor: '#eee'
    }));
}

var sv = Ti.UI.createScrollableView({
    left: 20,
    right: 20,
    top: 20,
    clipViews: false,
    views: views    
});

win.add(sv);
win.open();

Affects all devices, but easiest to see this behavior (from a visual perspective) on iPad.

Comments

  1. Stephen Tramer 2011-04-15

    Looks like this is possibly an Apple bug - scrollview end decelerate appears to be fired upon a rotation event. Going to investigate further.

  2. Jeff Haynie 2011-04-15

    (from [ff776214c7030cdfc64a8950dd87fe50ca723f43]) [#3206 state:fixed-in-qa] Check to see if the device rotates in the middle of scrolling; if so, snap to the nearest view. https://github.com/appcelerator/titanium_mobile/commit/ff776214c7030cdfc64a8950dd87fe50ca723f43"> https://github.com/appcelerator/titanium_mobile/commit/ff776214c703...

  3. Eric Merriman 2011-05-11

    Attempted to reproduce with iPhone 4, iOS 4.3.3. KS 1.7.0, build 1.7.0.879871b. Did not notice any odd behavior as I rotated while scrolling. Tried every combination of view change and scroll I could. Closing

JSON Source