Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7956] iOS: ImageView in ScrollView behaves differently in 1.8.2 and CI

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-03-14T14:39:10.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sn/a
ComponentsiOS
Labelsregression
ReporterNikhil Sharma
AssigneeVishal Duggal
Created2012-03-09T22:00:11.000+0000
Updated2017-03-09T23:07:42.000+0000

Description

ImageView in ScrollView behaves differently in 1.8.2 and 2.0.x CI build. In 2.0.x CI builds the image is initially zoomed in. Zoom in and zoom out also have different behaviors.

Repro Steps

1. Run the below code in both Ti SDK 1.8.2 and 2.0.x CI builds. 2. You can see the image is zoomed in 1.8.2 when the app starts and zoom in and zoom out have different behaviors.
var win1 = Titanium.UI.createWindow({  
    backgroundColor:'#fff'
});

var scrollView = Ti.UI.createScrollView({
  maxZoomScale: 2.0,
  minZoomScale: 0.3
});
var imageView = Ti.UI.createImageView({
  backgroundColor: 'pink',
  image: 'http://images.wikia.com/analytical/images/7/7e/Mountain.jpg'
});

scrollView.add(imageView);
win1.add(scrollView);

win1.open();

Comments

  1. Vishal Duggal 2012-03-14

    This is a behavior change due to composite layout definition. In 1.8.2 version undefined width and height of image view would default to FILL behavior as in width and height are constrained by parent size. In 2.0 undefined width and height of image view default to SIZE behavior as in SIZE is determined by image content. To see the same behavior in 2.0 as in 1.8.2 redefine imageView as
       var imageView = Ti.UI.createImageView({
         backgroundColor: 'pink',
         image: 'http://images.wikia.com/analytical/images/7/7e/Mountain.jpg',
         width:Ti.UI.FILL,
         height:Ti.UI.FILL
       });
       
  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source