[TIMOB-7885] iOS: Views - The child view is not clipped when child's width or height is larger than parent's view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-19T17:47:13.000+0000 |
Affected Version/s | Release 2.0.0, Release 1.8.2 |
Fix Version/s | Sprint 2012-05, Release 2.0.0 |
Components | iOS |
Labels | module_view, parity |
Reporter | Wilson Luu |
Assignee | Neeraj Gupta |
Created | 2012-03-05T15:24:00.000+0000 |
Updated | 2012-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
File | Date | Size |
---|---|---|
androidHeight.png | 2012-03-05T15:24:00.000+0000 | 20261 |
androidWidth.png | 2012-03-05T15:24:00.000+0000 | 20431 |
iOSHeight.png | 2012-03-05T15:24:00.000+0000 | 37540 |
iOSWidth.png | 2012-03-05T15:24:00.000+0000 | 37573 |
Fixed with composite layout changes in 2.0 release
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.
open to Update label