[TIMOB-2523] iOS: ScrollableView problems showing imageviews larger than screen
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-07-26T12:31:49.000+0000 |
Affected Version/s | Release 1.5.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | trident |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:21:53.000+0000 |
Updated | 2012-07-26T21:41:49.000+0000 |
Description
I submit a simple example of a scrollableview with 3 imageviews which are wider than the window's width.
The imageviews of three images 1024x1440 pixels (placed as
backgrounds to allow zooming) are sized to the maximum height of
the window, and therefore with a wider width; than added to the
scrollableview.
The images are double pages of a catalog.
Scrollableview correctly shows just the visible part of the
image, but trying to move right showing the other part of the
image, it scrolls to the following view.
If you try to first pinch in or out the image (zooming), then
scrollableview acts correctly first panning and then scrolling.
The attachments contains app.js, scrollview_problem.js and the
three images.
Put them in the resource folder of a new project.
I have Titanium developer 1.2.1, iphone SDK 4.2 and mobile titanium
sdk 1.4.2.
Attachments
File | Date | Size |
---|---|---|
scrollview_problem_prj_resources.zip | 2011-04-15T03:21:54.000+0000 | 673038 |
I solved patching the objective C source of the ScrollableView class.
I saw that the inner scrollviews created by the class for each view were not aware of the content size of the view itself. After the first zoom gesture they were and the scrolling was ok. So I modified the source that creates the inner scrollviews to set the contentsize property according to the size of the internal view.
This is the complete source of the refreshScrollView method from the ScrollableView.m file (mobile SDK 1.5.1).
The lines added are between comments.
Hope it's useful to somebody and please take this into consideration in the next mobile sdk release.
Need to discuss whether it's appropriate behavior to swipe immediately to the next view, or to pan across current view content.
Dupe of TIMOB-2504.