[TIMOB-25819] Android: ScrollView starts at the wrong location if it contains a ListView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-07-03T12:08:31.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | android, bug, listview, scrollview, titanium |
Reporter | Yahya Uddin |
Assignee | Joshua Quick |
Created | 2018-02-27T15:32:07.000+0000 |
Updated | 2018-07-03T22:25:38.000+0000 |
Description
When you have a ListView within a ScrollView on Android, sometimes the scroll view starts around the middle of the screen.
e.g.
<Alloy>
<Window class="container">
<ScrollView backgroundColor="blue" width="Ti.UI.FILL" height="Ti.UI.FILL" layout="vertical">
<View backgroundColor="red" width="Ti.UI.FILL" height="471">
<Label top="0">Start of the screen</Label>
</View>
<ListView backgroundColor="yellow" height="347"/>
</ScrollView>
</Window>
</Alloy>
However changing the ListView into a normal view seems to fix the issue.
In addition, there are times where the above window opens up fine. But most of the time it opens up incorrectly.
Note that this does not happen on iOS.
Tested on:
- Samsung S6 (real device) and
- Nexus 5 emulator (API 19)
with SDK: Titanium 7.0.2 GA
Attachments
File | Date | Size |
---|---|---|
how-it-should-look.png | 2018-02-27T15:30:01.000+0000 | 13493 |
how-it-starts-up.png | 2018-02-27T15:30:29.000+0000 | 9318 |
Hello, I was able to reproduce the issue on the Android with SDK 7.0.2.GA. Moving to TIMOB.
PR: https://github.com/appcelerator/titanium_mobile/pull/9901
*Closing ticket as fixed* Verified using the steps in the description above, ScrollView starts at the top of the page now. {noformat} SDK Ver: 7.3.0.v20180607210411 OS Ver: 10.13.5 Appc NPM: 4.2.13 Appc CLI: 7.0.4-5 Ti CLI Ver: 5.1.1 Node Ver: 8.9.4 NPM Ver: 6.0.0 Emulator: 7.1.1 Pixel 2 XL: 8.1.0 {noformat}
Everyone, The fix for this causes regression (see: [TIMOB-26167]) where a TextField/TextArea can no longer be edited if in a ScrollView. This issue needs to be solved a different way. I have a solution and plan on submitting a PR tomorrow.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10145
PR (7.3.x): https://github.com/appcelerator/titanium_mobile/pull/10149
Verified the fix in SDK 7.3.0.v20180703051211 Closing. Studio Ver: 5.1.0.201806291005 SDK Ver: 7.3.0.v20180703051211 OS Ver: 4.2.13 Xcode Ver: 7.0.4 Appc NPM: 1.1.3 Appc CLI: 10.13.5 Daemon Ver: Xcode 9.4.1 Ti CLI Ver: 5.1.1 Alloy Ver: 1.12.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.1 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 8.1.0 Emulator: ⇨ Android 4.1.2