[TIMOB-2833] Platform specific images are not being picked up from the Resources/iphone directory
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-11-05T15:50:45.000+0000 |
| Affected Version/s | Release 1.5.1 |
| Fix Version/s | Sprint 2011-30, Release 1.8.0 |
| Components | iOS |
| Labels | regression |
| Reporter | Kevin Whinnery |
| Assignee | Blain Hamon |
| Created | 2011-04-15T03:30:37.000+0000 |
| Updated | 2011-11-05T15:50:45.000+0000 |
Description
If I place an image in:
Resources/iphone/images/myimage.png
and reference it in app.js as:
var btn = Ti.UI.createButton({
backgroundImage:'images/myimage.png',
title:'foo'
});
it does not work - I have to place the image in:
Resources/images/myimage.png
for it to show up as the background image of my button. It's possible this extends to other resource types as well (JS files, etc), but I have not tested that
rollback wrong update
This is an open question that needs Xplatform alifnment and discussion
I have confirmed that this is a simulator issue. The same code works on device. I believe it is due to how the simulator is handling the paths versus the bundle for the device which places the images in the resources directory. Still a bug, but only for the simulator. Temporary workaround:
var path =''; if(Ti.Platform.model=='Simulator'){ path ='iphone/' } var image = Ti.UI.createImageView({ image: path+'images/default.png' });This bug makes developing a cross-platform app with density specific images very difficult.
Pull request 292 is in queue. It's a change to the build process, not the code, although it does obsolete some code.
Tested On: Mac OSX Lion TiMob: 1.8.0.v20110819142548 TiStud: 1.0.4.201108101535 Devices: iPhone 4 version 4.2.10 iPad2 version 4.3.5 iPod 3
Standardizing summary and labels.