createImageView Sizing Issues on Android
Hello, everyone!
I'm working on an Android app in OSX and I've run into a very odd sizing issue.
var win1 = Titanium.UI.createWindow({
titleImage:'images/appcelerator_small.png',
backgroundImage:'images/background.png'
});
var logoImage = Titanium.UI.createImageView({
width: 286,
height: 169,
top:30,
left:30,
image:'images/title.png'
});
var observe = Titanium.UI.createImageView({
width: 174,
height: 174,
top:325,
left:44,
image:'images/observe.png'
});
var review = Titanium.UI.createImageView({
width: 174,
height: 174,
top:325,
left:262,
image:'images/review.png'
});
win1.add(logoImage);
win1.add(observe);
win1.add(review);
win1.open({fullscreen:true});
Here's a screenshot of what's going on, as well as a fake screenshot to show you the correct rendering. Can anyone give me a heads up as to what could be going wrong? canScale values don't seem to change anything. The dimensions of each image are correct, so I'm completely lost. I'm using SDK 2.2 with the WVGA800 screen size.
Thank you so much!
2 Answers
-
Image scaling on Android doesn't currently work. See Ticket #32238. Scheduled for a fix in the 1.5.0 release.
-
I just discovered that I've been working in pixels when I should have been working in density-independent pixels, which equal 1.5 physical pixels on the HTC Incredible's WVGA800 screen. Tacking on /1.5 to each of my width and height values fixed the problem completely.