GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2018-03-15T22:17:44.000+0000 |
Affected Version/s | Appcelerator Studio 4.5.0 |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Bhushankumar pawar |
Assignee | Shak Hossain |
Created | 2018-02-02T13:00:35.000+0000 |
Updated | 2018-05-08T18:12:48.000+0000 |
Ti.UI.SIZE not working in Scroll View on Android after SDK onward 6.3.0 GA.
Added label in scroll view and apply property of Ti.UI.SIZE to scroll view but it not taking it as size and it get's FILL across the screen.
[~bpawar], can you provide more details please? And test code to reproduce it? Because I can't reproduce this issue. The following code does a Ti.UI.SIZE on a label within a ScrollView and it does correctly size the label to just-fit the text. Note that the below shows a blue background for the label so that you can easily see it's actual width and height.
If we apply the width: Ti.UI.SIZE, to scroll view then the issue is observed. var window = Ti.UI.createWindow(); var scrollView = Ti.UI.createScrollView( { layout: "vertical", // layout: "composite", showHorizontalScrollIndicator: false, shorVerticalScrollIndicator: true, *{color:#d04437}width: Ti.UI.SIZE,{color}* height: Ti.UI.FILL, }); scrollView.add(Ti.UI.createLabel( { text: "Hello World", color: "white", backgroundColor: "blue", width: Ti.UI.SIZE, height: Ti.UI.SIZE, })); window.add(scrollView); window.open();
Hello [~bpawar], I am also not able to reproduce the issue with the above sample code you provided. I also get the label with a blue background as the sample code by [~jquick], Thanks.
Thanks Sharif, Can you please check below code snippet. Here we can observe that scrollView(yellow background) is filling all window for android for iOS it is working fine. PFA. !Screen Shot 2018-02-05 at 11.48.55 AM.png|thumbnail! var window = Ti.UI.createWindow(); var scrollView = Ti.UI.createScrollView( { layout: "horizontal", // layout: "composite", showHorizontalScrollIndicator: false, shorVerticalScrollIndicator: true, width: Ti.UI.SIZE, height: Ti.UI.FILL, backgroundColor: "yellow", height : "40dp" }); scrollView.add(Ti.UI.createLabel( { text: "Hello World", color: "white", backgroundColor: "blue", width: Ti.UI.SIZE, height: Ti.UI.SIZE, } )); window.add(scrollView); window.open();
[~bpawar], I'm able to reproduce it now. Thanks. Right, the issue is that the ScrollView width ignores Ti.UI.SIZE and does a FILL instead. This issue was introduced when we added "RefreshControl" support to ScrollView. It's technically a bug on Google's end where their Java "SwipeRefreshLayout" class ignores the "WRAP_CONTENT" setting, which is the Android equivalent of our Ti.UI.SIZE setting. We'll have to work-around this issue and calculate it ourselves.
I've written up a bug report for it here: [TIMOB-25753]
Waiting for the fix on 7.1.1 release.
This issue was fixed in Titanium 7.1.1 which is available today.