Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5176] Android images in imageview won't scale without explicit width and height

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-09-26T15:18:12.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-38, Release 1.8.0
ComponentsAndroid
Labelsimageview, merged-v8, parity, scale, stage
ReporterBill Dawson
AssigneeBill Dawson
Created2011-08-30T13:44:02.000+0000
Updated2011-10-31T22:37:24.000+0000

Description

Given the attached large photo "julia.jpg" and this app.js:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#000',
	exitOnClose: true
});

var v = Ti.UI.createView({
	top: "33%", height: "33%", left: "33%", right: "33%",
	backgroundColor: "blue"
});

var img = Ti.UI.createImageView({image: "julia.jpg"});
v.add(img);

win.add(v);
win.open();
Our iOS implementation will scale that graphic to make it fit and look good in the ImageView. Our Android implementation won't scale it at all but rather just show part of the center of the image.

Attachments

FileDateSize
julia.jpg2011-08-30T13:46:44.000+0000739261

Comments

  1. Bill Dawson 2011-09-21

    Turns out this was basically part of TIMOB-5177. Pull request ready: https://github.com/appcelerator/titanium_mobile/pull/485
  2. Don Thorp 2011-09-26

    test, review, merge.
  3. Alan Vaghti 2011-10-13

    Closing. Fix verified on Nexus One 2.2.2 with SDK 1.8.0.v20111013161411

JSON Source