[TIMOB-19035] Android: Ti.UI.SIZE on ScrollableView not working
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-07-06T20:02:28.000+0000 |
| Affected Version/s | Release 6.1.1 |
| Fix Version/s | Release 6.2.0 |
| Components | Android |
| Labels | n/a |
| Reporter | Ethan Chen |
| Assignee | Gary Mathews |
| Created | 2015-06-17T09:43:38.000+0000 |
| Updated | 2017-12-23T03:57:16.000+0000 |
Description
When I set the height
Ti.UI.SIZE to the ScrollableView on Android, it will look like Ti.UI.FILL, but when I set a number for height, like '100dp', it will work.
This problem was not happened on iOS.
Hello, I have tested this issue. and i was able to regenerate the issue.
TESTING ENVIRONMENT
Appcelerator Command-Line Interface, version 4.0.2 Titanium SDK 4.0.0.GA Appcelerator Studio, build: 4.0.1.201506021908 Android 5.0.1, 5.0.0CODE SAMPLE
var win = Ti.UI.createWindow(); var view1 = Ti.UI.createView({ backgroundColor:'#123', height: '300dp' }); var view2 = Ti.UI.createView({ backgroundColor:'#246', height: '300dp' }); var view3 = Ti.UI.createView({ backgroundColor:'#48b' ,height: '300dp'}); var scrollableView = Ti.UI.createScrollableView({ height: Titanium.UI.SIZE, views:[view1,view2,view3], showPagingControl:true }); win.add(scrollableView); win.open();OBSERVED RESULT
Setting the height Ti.UI.SIZE to the ScrollableView on Android dose't work and response as Ti.UI.FILL, But when set a number for height, like '100dp', it will work. Everything works fine in iOS. Thanks.Any update here?
+1 ... Really could use a fix for this ...
8 months later... A fix would be helpful!
Any update?
14 months later.. update?
master: https://github.com/appcelerator/titanium_mobile/pull/8580
Verified the fix.
Ti.UI.SIZEworks as expected. Closing. Appc Studio : 4.8.1.201611291132 SDK Version : 6.1.0.v20161129071600 Mac OS Version : 10.12 Xcode Version : Xcode 8.1 Build version 8B62 Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0-302"} Ti CLI : 5.0.11 Alloy : 1.9.4 Node : v4.6.0 Device: running 7.1PixelThis is not fully fixed, The following example with SDK 6.1.1.GA is crashing:
Crash trace:var win = Ti.UI.createWindow({ backgroundColor: 'white', layout: 'vertical' }), lbl_a = Ti.UI.createLabel({ text: 'View A', height: Ti.UI.SIZE }), lbl_b = Ti.UI.createLabel({ text: 'View B', height: 100 }), view_a = Ti.UI.createView({ backgroundColor: 'red', height: 100, width: '90%' }), view_b = Ti.UI.createView({ backgroundColor: 'green', height: Ti.UI.SIZE, width: '90%' }), scrollable = Ti.UI.createScrollableView({ views: [view_b, view_a], width: Ti.UI.FILL, height: Ti.UI.SIZE, top: '30dip' }); view_a.add(lbl_a); view_b.add(lbl_b); win.add(scrollable); win.open();master: https://github.com/appcelerator/titanium_mobile/pull/9192
Gary I tested the commit and the app is not crashing but the scrollable view didn't resize correctly. Did it resize it for you ? Thanks a lot!
Verified Fix in SDK Version: 6.2.0.v20170808135421 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/9192
[~hini], the fix for [TIMOB-25626] involves refactoring the Ti.UI.SIZE handing of the ScrollableView for both width and height. It will likely resolved the remaining sizing edge-cases left. This fix is currently scheduled for Titanium 7.1.0, so, stay tuned.