Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15470] Android: ImageView within ScrollView does not resize correctly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-08-08T11:47:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
LabelsimageView, resize, scrollview
ReporterMads Moller
AssigneeIngo Muschenetz
Created2013-10-11T13:38:02.000+0000
Updated2017-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

FileDateSize
correct.png2013-10-11T13:38:02.000+0000137668
wrong.png2013-10-11T13:38:02.000+0000273357

Comments

  1. Jamie Buckley 2013-10-13

    Tested with Android 2.3.3 - 4.2 and Titanium 3.1.0GA - 3.1.3GA Image did not resize when in scrollview.
  2. jithinpv 2014-08-08

    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
  3. Lee Morris 2017-03-27

    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

JSON Source