[TIMOB-8247] iOS: ImageView - ImageView does not auto size image view correctly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-27T09:35:04.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-07 |
Components | iOS |
Labels | parity, qe-and031912, qe-nfc |
Reporter | Wilson Luu |
Assignee | Vishal Duggal |
Created | 2012-03-23T13:38:50.000+0000 |
Updated | 2012-03-27T09:35:04.000+0000 |
Description
Steps to reproduce:
1. Run code on Android:
// Create an image view on a parent that is width and height constrained
// See that the image view sizes itself accordingly
var win = Ti.UI.createWindow();
win.backgroundColor = 'white';
var label = Ti.UI.createLabel({
text: 'Image View should auto size to image, but stay within red',
top: 20,
left: 10,
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
color: 'black'
});
var view1 = Ti.UI.createView({
height: 30,
width: 60,
top: 80,
backgroundColor: 'red'
});
var imageView1 = Ti.UI.createImageView({
image: 'flower.jpg',
backgroundColor: 'blue'
});
var view2 = Ti.UI.createView({
height: 50,
width: 120,
top: 140,
backgroundColor: 'red'
});
var imageView2 = Ti.UI.createImageView({
image: 'flower.jpg',
backgroundColor: 'blue'
});
var view3 = Ti.UI.createView({
height: 70,
width: 180,
top: 220,
backgroundColor: 'red'
});
var imageView3 = Ti.UI.createImageView({
image: 'flower.jpg',
backgroundColor: 'blue'
});
view1.add(imageView1);
view2.add(imageView2);
view3.add(imageView3);
win.add(view1);
win.add(view2);
win.add(view3);
win.add(label);
win.open();
Actual: ImageView will fill parent view. See attachment.
Expected: ImageView should not fill parent view (respect image ratio).
Note:
* Above code works as expected on Android.
Attachments
File | Date | Size |
---|---|---|
device-2012-03-23-143600.png | 2012-03-23T13:40:24.000+0000 | 61208 |
flower.jpg | 2012-03-23T13:38:50.000+0000 | 17766 |
on_ios.png | 2012-03-23T15:40:04.000+0000 | 203978 |
Screen Shot 2012-03-26 at 12.52.17 PM.png | 2012-03-26T11:53:16.000+0000 | 100786 |
Ignore attachment with button.
Also occurs on: Titanium Studio, build: 2.0.0.201203262445 SDK: 2.0.0.v20120325213306 Device: Android Nexus S (2.3.6)
this also fails on Android(2.2.2)- nexus one, when tests on Titanium mobilesdk-2.0.0.v20120325213306 Titanium Studio build: 2.0.0.201203262445
Also occurs on Kindle Fire and Nook Color Titanium SDK: 2.0.0.v20120325213306 Titanium Studio, build: 2.0.0.201203262445
iOS Behavior in 1.8.2 attached; note image scaling rather than cropping behavior.
Pull pending https://github.com/appcelerator/titanium_mobile/pull/1845
Closing bug. Verified fix on: SDK build: 2.0.0.v20120326211803 Titanium Studio, build: 2.0.0.201203262445 xcode: 4.3 Device: iphone 4s Verizon (5.0.1)