Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7847] iOS: Scrollable View height property set to 'auto' returns value 0 and is not visible

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-04-05T16:45:23.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0
Fix Version/sSprint 2012-05, Release 2.0.0
ComponentsiOS
Labelsmodule_scrollableview, parity, qe-testadded
ReporterNikhil Sharma
AssigneeNeeraj Gupta
Created2012-02-29T01:15:18.000+0000
Updated2014-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);

Comments

  1. Allen Yeung 2012-03-20

    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.
  2. Michael Pettiford 2012-03-21

    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
  3. Michael Pettiford 2012-04-05

    Reopening/closing to add/remove label
  4. jithinpv 2013-11-10

    Anvil test case added. https://github.com/appcelerator/titanium_mobile/pull/4943

JSON Source