[TIMOB-15470] Android: ImageView within ScrollView does not resize correctly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-08-08T11:47:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | imageView, resize, scrollview |
Reporter | Mads Moller |
Assignee | Ingo Muschenetz |
Created | 2013-10-11T13:38:02.000+0000 |
Updated | 2017-03-27T20:18:28.000+0000 |
Description
When creating an imageView where the image is too large for the imageView, it is expected to resize, when setting the width, and SIZE for height.
This works fine, then the imageView is added directly to the window. But if the imageView is added to a scrollView, then it fails to resize.
*WORKS: (see: correct.png)*
var win = Ti.UI.createWindow({
backgroundColor : "#FFF",
fullscreen : false
});
var imageView = Ti.UI.createImageView({
image : "http://www.menucool.com/slider/prod/image-slider-4.jpg",
preventDefaultImage : true,
width : "320dp",
height : Ti.UI.SIZE
});
win.add(imageView);
*DOES NOT WORK: (see wrong.png)*
var win = Ti.UI.createWindow({
backgroundColor : "#FFF",
fullscreen : false
});
var scrollView = Ti.UI.createScrollView();
var imageView = Ti.UI.createImageView({
image : "http://www.menucool.com/slider/prod/image-slider-4.jpg",
preventDefaultImage : true,
width : "320dp",
height : Ti.UI.SIZE
});
scrollView.add(imageView);
win.add(scrollView);
*Steps to reproduce*
* create new project
* paste above code
* run on android
Attachments
File | Date | Size |
---|---|---|
correct.png | 2013-10-11T13:38:02.000+0000 | 137668 |
wrong.png | 2013-10-11T13:38:02.000+0000 | 273357 |
Tested with Android 2.3.3 - 4.2 and Titanium 3.1.0GA - 3.1.3GA Image did not resize when in scrollview.
cannot reproduce Titanium Studio, build: 3.3.0.201407100905 Titanium SDK version 3.3.0.GA CLI version 3.3.0, device: HTC Desire X (HT35XLY01791) Android 4.1.1 Targeting Android SDK: 20
Closing ticket as I am unable to reproduce this issue with the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80