Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2833] Platform specific images are not being picked up from the Resources/iphone directory

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-11-05T15:50:45.000+0000
Affected Version/sRelease 1.5.1
Fix Version/sSprint 2011-30, Release 1.8.0
ComponentsiOS
Labelsregression
ReporterKevin Whinnery
AssigneeBlain Hamon
Created2011-04-15T03:30:37.000+0000
Updated2011-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

Comments

  1. Nikolai Derzhak 2011-04-15

    rollback wrong update
  2. Ralf Pfeiffer 2011-05-03

    This is an open question that needs Xplatform alifnment and discussion
  3. Alan Leard 2011-07-15

    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'
       });
       
  4. Alan Leard 2011-07-15

    This bug makes developing a cross-platform app with density specific images very difficult.
  5. Blain Hamon 2011-07-26

    Pull request 292 is in queue. It's a change to the build process, not the code, although it does obsolete some code.
  6. Vikramjeet Singh 2011-08-29

    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
  7. Don Thorp 2011-11-05

    Standardizing summary and labels.

JSON Source