Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7885] iOS: Views - The child view is not clipped when child's width or height is larger than parent's view

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-04-19T17:47:13.000+0000
Affected Version/sRelease 2.0.0, Release 1.8.2
Fix Version/sSprint 2012-05, Release 2.0.0
ComponentsiOS
Labelsmodule_view, parity
ReporterWilson Luu
AssigneeNeeraj Gupta
Created2012-03-05T15:24:00.000+0000
Updated2012-04-19T17:47:13.000+0000

Description

Details: If a child view's width or height is larger than the parent view's width or height, the child view will not be clipped. On Android, the below code works as expected for both V8 and Rhino. See attachments. Steps to reproduce: 1. Run the following code on iOS:
var win = Ti.UI.createWindow();

win.backgroundColor = 'white';

var view = Ti.UI.createView({
backgroundColor: 'yellow',
top: '100px',
height: '150px',
width: '150px'
});

// uncomment this line and comment the other view2 to see width clipping bug 
// var view2 = Ti.UI.createView({ backgroundColor: 'blue', height: '75px', width: '180px', }); 

// height clipping bug
var view2 = Ti.UI.createView({ backgroundColor: 'blue', height: '180px', width: '75px', });

var label = Ti.UI.createLabel({ top: 20, left: 10, height: 'auto', width: 'auto', color: 'black' });
label.text = 'The blue rectangle should stay within the yellow square:';

view.add(view2);
win.add(view);
win.add(label);
win.open();
Actual: Child view is not clipped appropriately on iOS. See attachments. Expected: Child view should be clipped appropriately on iOS.

Attachments

FileDateSize
androidHeight.png2012-03-05T15:24:00.000+000020261
androidWidth.png2012-03-05T15:24:00.000+000020431
iOSHeight.png2012-03-05T15:24:00.000+000037540
iOSWidth.png2012-03-05T15:24:00.000+000037573

Comments

  1. Vishal Duggal 2012-03-20

    Fixed with composite layout changes in 2.0 release
  2. Wilson Luu 2012-03-21

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120321071752 Titanium Studio, build: 2.0.0.201203202130 xcode: 4.2 Device: iphone 4s (5.0.1) Note to QE: When porting, notice there are two test cases here.
  3. Natalie Huynh 2012-04-19

    open to Update label

JSON Source