Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8696] MobileWeb: Parity: The minimum width of contentWidth/contentHeight should be the size of the scroll view.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-06-14T15:31:28.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-12 MW
ComponentsMobileWeb
Labelsparity
ReporterAllen Yeung
AssigneeChris Barber
Created2012-04-11T20:43:00.000+0000
Updated2017-03-16T20:55:52.000+0000

Description

//Create a Ti.UI.View with scroll view and do not put any content 
 
var win = Ti.UI.createWindow();
win.backgroundColor = 'white';
 
var label = Ti.UI.createLabel({
    text: 'View Size is: ',
    top: 20,
    left: 10,
    height: Ti.UI.SIZE,
    width: Ti.UI.SIZE,
    color: 'black'
});
 
var scrollView = Titanium.UI.createScrollView({
    contentHeight:'50',
    contentWidth:'auto',
    showVerticalScrollIndicator:true,
    showHorizontalScrollIndicator:true
});
 
var view = Ti.UI.createView();
 
var view2 = Ti.UI.createView({
    backgroundColor:'red'
    
})
 
scrollView.add(view2);
 
win.addEventListener('postlayout', function layoutHandler(e) {
    win.removeEventListener('postlayout', layoutHandler);
    label.text = 'ScrollView\'s height and width: ' + scrollView.size.height + 'x' + scrollView.size.width + '\n' +
                 'Screen\'s height and width: ' + win.size.height + 'x' + win.size.width;
    win.addEventListener('postlayout', layoutHandler);
});
 
win.add(scrollView);
win.add(view);
view.add(label);
 
win.open();
In the code above, the height of view2 should be the size of the scroll view and not 50.

Comments

  1. Bryan Hughes 2012-06-13

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2387
  2. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source