Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11610] iOS:Remote Images inside a vertical ScrollView not scaling properly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-13T19:46:49.000+0000
Affected Version/sRelease 2.1.2, Release 2.1.3
Fix Version/sRelease 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23
ComponentsiOS
Labelscore, layout, module_scrollview, parity, qe-testadded, triage
ReporterAmuktha Akkinepally
AssigneeVishal Duggal
Created2012-10-30T22:20:14.000+0000
Updated2014-06-19T12:44:20.000+0000

Description

When trying to add an imageView to a scrollView with a vertical layout, the imageView has a height that is much larger than the image that is displayed. The image is being scaled and displayed but there is a white blank space displayed above, below and around the image. It works fine on Android.

Steps to reproduce:

1.Load the below app.js 2.Run on a iOS Simulator/Device 3.Run the same on Android Device Expected: There should be no space above the image like in android. Actual Behavior: There is some empty space above and below the image

app.js:

var detailWindow = Titanium.UI.createWindow({
	backgroundColor : '#fff'
});

var detailScrollView = Ti.UI.createScrollView({
	layout : 'vertical'
});

var imageView = Ti.UI.createImageView({
	image : "https://s3.amazonaws.com/static.tumblr.com/6t3upxl/Aawm08w0l/khout-kitten-458882.jpeg",
	top : '10dp'

});

detailScrollView.add(imageView);

detailWindow.add(detailScrollView);

detailWindow.open(); 


Attachments

FileDateSize
Screenshot of Android when ScrollView layout is vertical.png2012-10-30T22:20:14.000+00006277886
Screenshot of iOS with ScrollView layout vertical.png2012-10-30T22:20:14.000+0000131152

Comments

  1. Amuktha Akkinepally 2012-11-01

  2. Vishal Duggal 2012-11-08

    The behavior of both iOS and android is incorrect contentWidth and contentHeight are both undefined so the contents should stretch to show the full image
  3. Vishal Duggal 2012-11-08

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/3396
  4. Anshu Mittal 2013-01-18

    Tested with: SDK:3.1.0.v20130114171802 Studio:3.0.1.201212181159 Device: iPad2(v5.1), iphone3GS(v 5.0.1), iPad4(v 6.0) Images are scaled properly inside a vertical scrollview

JSON Source