imageView scaling in Android
Hi,
I'm adding an image my window using this code:
var thisImage = Ti.UI.createImageView({
width: 110,
height: 75,
canScale:true,
enableZoomControls:false,
url: '1_over.png',
size: { height: 75, width: 110 }
});
win.add(thisImage);
The image is scaled up around 120%. I read that this is a common problem, but everyone says that the canScale property fixes this, but it doesn't. Anyone ?
I am using Titanium SDK 1.4.0. and testing it on Android 2.1. The resolution of my emulator is 800x480, maybe that is a problem?
Thanks in advance,
Rik de Vos
2 Answers
-
Accepted Answer
Hi Rik
First of all, the imageView url property has been deprecated - don't use it! Take a look at the ImageView-object documentation.
There is a known bug with image scaling. Look at ticket #1434 for further info.
Cheers
Hal
-
Thanks Hal, but it didn't really help me :(
Yes, the url property has been deprecated, but even if I use 'image' instead of 'url' it still doesn't work.
So I looked at ticket #1434, but with the canScale property on, and then the enableZoomControls property off it still doesn't work.
The image is 110 x 75, but when I set the height and with to around 73 x 50 , which is 0.67 times the original size, the image does show as 110 x 75. This doesn't make any sense ?!?