Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2956] Android imageView not displaying local images

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2012-02-15T13:39:07.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterChris Nelson
AssigneeMauro Parra-Miranda
Created2012-02-09T13:45:18.000+0000
Updated2016-03-08T07:47:57.000+0000

Description

var self = Ti.UI.createView({ backgroundColor:'white' }); var logo = Ti.UI.createImageView({ image:'images/logo.png', top:'5dp', height:'100dp', width:'100dp', hires:true }); self.add(logo); Works fine in iOS. Android returns http://pastie.org/3350840 Never had an issue with this before until I started using the common.js pattern. I searched the current issues already but most seem to be related to windows build environments.

Comments

  1. Mauro Parra-Miranda 2012-02-15

    Hello, you can solve this adding an slash: if (Titanium.Platform.name == 'android') { win.backgroundImage = '/images/home.jpg'; } Best, Mauro
  2. Chris Nelson 2012-02-15

    That seemed to do the trick. Sorry for the silly question.
  3. Shak Hossain 2013-12-10

    Closing as per updates from Chris.

JSON Source