[TIMOB-25474] Android: scrollview not scrolling when moving from SDK 5.5.1 to 6.3.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2018-04-13T17:44:11.000+0000 |
Affected Version/s | Release 6.3.0, Release 6.2.2 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Raymond Verbruggen |
Assignee | Joshua Quick |
Created | 2017-11-02T12:24:29.000+0000 |
Updated | 2018-04-13T17:44:11.000+0000 |
Description
Scrollview works fine in SDK 5.5.1, the identical code compiled for SDK 6.3.0 the same scrollview does not work anymore.
This is urgent, I need to update my app for Android 7!!
5.5.1 OK 6.1.2 OK 6.2.2 not ok 6.3.0 not ok
[~ray@raymondverbruggen.nl] Could you provide a test case and explain what behaviour is not working as expected?
[~ray@raymondverbruggen.nl], we're unable to reproduce this issue. If you can send us a reproducible case, then that would be great. Thanks.
The scrollview was part of a parent view. I was able to pin it down to the following changes: Basically width and height parameters, resp contentWidth and contentHeight. No idea why that helped... exports.createForm = function(o) { var container = Ti.UI.createView({ layout : 'vertical', width: '100%', height: Ti.UI.SIZE, backgroundColor : 'white' }); var fieldRefs = {}; var form = Ti.UI.createScrollView({ contentWidth : '100%', contentHeight : Ti.UI.SIZE, showVerticalScrollIndicator : true, showHorizontalScrollIndicator : false, scrollType : 'vertical', // new stuff container : container, fieldStyle : o.style || exports.STYLE_HINT, addField : addField, addFields : addFields }); form.addFields(o.fields, fieldRefs); var padding = Ti.UI.createLabel({ height : 20 }); container.add(padding); form.add(container); // Add this so each field can be accessed directly, if necessary form.fieldRefs = fieldRefs; return form; }; exports.createForm = function(o) { var container = Ti.UI.createView({ layout : 'vertical', height : 'auto', borderRadius : 5, borderWidth : 0, backgroundColor : 'white' }); var fieldRefs = {}; var form = Ti.UI.createScrollView({ contentHeight : 'auto', contentWidth : 'auto', showVerticalScrollIndicator : true, showHorizontalScrollIndicator : true, // new stuff container : container, fieldStyle : o.style || exports.STYLE_HINT, addField : addField, addFields : addFields }); form.addFields(o.fields, fieldRefs); var padding = Ti.UI.createLabel({ height : 20 }); container.add(padding); form.add(container); // Add this so each field can be accessed directly, if necessary form.fieldRefs = fieldRefs; return form; };
[~ray@raymondverbruggen.nl], the code you've posted is incomplete. So, it's difficult to tell what's going on. But I did notice that your ScrollViews are set up to use a "composite" layout (not "vertical" or "horizontal" layouts). Would you mind doing a quick test on your end? Try setting the ScrollView's "contentHeight" property to a large value, such as 5000. Then check if it's scrollable.
I believe we have the same issue. In the following example I have a horizontal scrollview inside a vertical scrolling one. The parent (vertical scrolling) scrolls fine, the horizontal scrollview is 'moveable', but doesn't scroll as expected. It looks like if the don't move your finger only over the x-axis, the scrolling works, but as soon as you move up or down, the event goes to the parent (vertical) scrolling view. The following is tested on 7.0.2.GA and worked fine before 6.
This is a real issue and is very easy to replicate, I am currently experiencing it myself. As clearly stated by [~gertjans] it is trivial to reproduce the very obvious error that occurs. With that in mind, I took his exact same code and tried it, I have the same issues on 6.3.0 but not on 6.1.2. I then decided to modify the code slightly so there could be not question that any use of older constants like percentages or 'auto' would play a part. That also failed on 6.3.0 but worked on 6.1.2. So my experience in my own app where this is now a blocker is easily replicated with the minimalist of code. My own code uses Alloy to perform all the operations that the code given by Gertjans Smits does, so this is not an Alloy related problem, simply a Ti problem. It also affects all versions above 6.1.2 including the most recent one as far as I am able to determine and also shown by both other people including the original reporter [~ray@raymondverbruggen.nl] expressing their concern about this issue. I have provided my variation on the code provided above. I have simply tweaked some constants, increased the colour pool, re-ordered a couple of parts with named labels. All with the aim of showing just how easy this is to replicate. I have also added properties that should not be required; bubbleeParent and canCancelEvents. All variations failed to provide any changes other than total failure. The last time I saw this sort of issue was just before Ti 3.x.
This problem should be considered a blocker.
Okay. We're able to reproduce it now. The issue is with scrolling a child "horizontal" ScrollView within a parent "vertical" ScrollView. All other nested child views scroll as expected (ie: vertical ScrollViews/TableView/ListView within a vertical ScrollView scroll fine). I've written this up as a separate ticket to better clarify the issue here: [TIMOB-25792] I've also posted a work-around in that same ticket.
Great news Joshua!!
We plan on resolving this issue in Titanium 7.2.0. Keep an eye on ticket [TIMOB-25792] for more details. Thank you for reporting this issue.