[TIMOB-7847] iOS: Scrollable View height property set to 'auto' returns value 0 and is not visible
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-05T16:45:23.000+0000 |
Affected Version/s | Release 1.8.0.1, Release 2.0.0 |
Fix Version/s | Sprint 2012-05, Release 2.0.0 |
Components | iOS |
Labels | module_scrollableview, parity, qe-testadded |
Reporter | Nikhil Sharma |
Assignee | Neeraj Gupta |
Created | 2012-02-29T01:15:18.000+0000 |
Updated | 2014-02-24T19:48:39.000+0000 |
Description
Scrollable View height property set to 'auto' returns value 0 and is not visible.
Repro Steps
1. Run the below code. 2. Scrollable view height is 'auto' and you can see the scrollable view is not visible.
var win = Ti.UI.createWindow({
background: 'green',
})
win.open();
var vImageCase = Ti.UI.createView({
height: 'auto',
//height: 150,
layout: 'vertical',
top: 0,
});
var ivPhoto2 = Ti.UI.createImageView({
image: 'http://v2.suedostschweiz.ch/var/upload/news/image/127563_640.jpg',
height: 230,
top: 0,
});
vImageCase.add(ivPhoto2);
var vImageLegend = Ti.UI.createView({
height: 'auto',
layout: 'vertical',
backgroundColor: '#E6E6E6',
});
vImageCase.add(vImageLegend);
var lLegend = Ti.UI.createLabel({
height: 'auto',
text: 'image[0].image_legend',
});
vImageLegend.add(lLegend);
// If more images than 1, create scrollable view
var ScrollableView = Ti.UI.createScrollableView({
views: [vImageCase],
showPagingControl: true,
pagingControlHeight: 30,
pagingControlColor: '#899DA2',
currentPage: 0,
top: 50,
left: 0,
height: 'auto',
// height: 250,
});
win.add(ScrollableView);
Just tested this in master and looks like it has been fixed by the composite layout behavior spec. The height no longer returns 0, and appears in iOS.
Closing issue Tested with Ti Studio build 2.0.0.201203202130 Ti Mob SDK 2.0.0.v20120321071752 hash r4c936bac OSX Lion 10.7.3 iPhone 4S OS 5.0.1 Scrollable view is visibile
Reopening/closing to add/remove label
Anvil test case added. https://github.com/appcelerator/titanium_mobile/pull/4943