Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7344] iOS: Views - Nested view cannot be displayed when dimension property is defined using percentage

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-15T13:25:44.000+0000
Affected Version/sRelease 1.8.0.1, Release 1.8.1
Fix Version/sRelease 2.0.0
ComponentsiOS
Labelsmodule_view, parity, qe-ios012312, qe-testadded
ReporterWilson Luu
AssigneeMax Stepanov
Created2012-01-23T16:45:10.000+0000
Updated2012-03-15T13:25:44.000+0000

Description

Steps to reproduce: 1. Copy code below to app.js:
var win = Ti.UI.createWindow({
  layout: 'vertical', 
  fullscreen: true
});

var view = Ti.UI.createView({
  layout: 'horizontal',
  height: 50,
  backgroundColor: '#ccf',
  width: '50%'
});
var nested_view = Ti.UI.createView({
  height: 50,
  backgroundColor: '#cfc',
  width: '50%'
});

var control = Ti.UI.createView({
	layout:'horizontal',
	height:50,
	backgroundColor: 'red',
	width: 160 // 50% of portrait screen width
});
var nested_control = Ti.UI.createView({
	height:50,
	backgroundColor:'green',
	width: 80 // 25% of portrait screen width
});

view.add(nested_view);
win.add(view);

control.add(nested_control);
win.add(control);

win.open();
2. Launch app to an iOS device Actual: Nested view is not displayed i.e. only one color is displayed on the view. See attachment. Expected: Should see two colors on the view like Android's behavior. See attachment.

Attachments

FileDateSize
actual.png2012-01-23T16:45:10.000+000019600
expected.png2012-01-23T16:45:10.000+00008641

Comments

  1. Max Stepanov 2012-02-06

    Please note that the expected layout when position (left/top/right/bottom) is not specified is center. Thus the expected.png image above is incorrect and a separate issue should be created for nested view positioning with absolute width/height.
  2. Stephen Tramer 2012-02-09

    Fixes must regress against the following in KS *at minimum*: KS->Base UI->Views->Auto Height KS->Base UI->Views->Min Height KS->Base UI->Vertical->Basic KS->Base UI->Vertical->Table View KS->Base UI->Table Views->Layout 4 KS->Base UI->Table Views->Table Auto Height
  3. Michael Pettiford 2012-02-10

    Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120209183134 OSX Lion 10.7.3 iPhone 4S OS 5.0.1, iPad 1 OS 5.0.1 Verified sample code, and KS tests all pass
  4. Blain Hamon 2012-02-23

    Must reopen to update fix version. 1.8.2 will NOT have this fixed due to regressions, but MASTER still has it.
  5. Blain Hamon 2012-02-23

    Still fixed in master, leaving unfixed in 1.8.2.
  6. Blain Hamon 2012-02-23

    Reclosing to indicate fixed in master.
  7. Tamila Smolich 2012-02-27

    This bug occurs in: Titanium SDK version: 1.8.2.v20120223174636 Device Details: iPad1 5.0.1 Titanium Studio version: 1.0.9.201202141208
  8. Max Stepanov 2012-02-27

    Fixed only for 1.9.0 release.
  9. Wilson Luu 2012-03-15

    Closing bug. Verified fix using sample code and KS tests on: SDK build: 2.0.0.v20120315123246 Titanium Studio, build: 2.0.0.201203142055 xcode: 4.2 Device: iphone 4s (5.0.1)

JSON Source