Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18274] iOS: Images property cannot load array of images from the applicationDataDirectory

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2014-12-22T18:20:47.000+0000
Affected Version/sRelease 3.4.1, Release 3.5.0
Fix Version/sn/a
ComponentsiOS
Labelsfilesystem, images, ios, qe-3.5.0
ReporterEric Wieber
AssigneeIngo Muschenetz
Created2014-12-20T00:27:43.000+0000
Updated2014-12-22T23:27:17.000+0000

Description

Images in ImageViews, tab icons,etc, can not be loaded from the applicationDataDirectory. This is not a regression as I encounter the same issue with SDK 3.4.1.GA. This applies to the "images" property (separate from the "image" property) *Steps to reproduce issue*: 1. Run project with below code 2. Notice that the image at the bottom of the screen is not loaded *Expected result*: Both the top and bottom image are loaded *Notes*: This is not a regression. The same behavior is witnessed even when passing in 'file' or 'blob' objects to the array. Here is the sample code to replicate:
Titanium.UI.setBackgroundColor('#000');

var win2 = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#fff'
});

var image1 = Titanium.UI.createImageView({
  top: 10,
  image: "/appicon.png"
});

var icon = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'appicon.png');
var dest = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'appicon.png');

dest.write(icon.read());

var image2 = Titanium.UI.createImageView({
  bottom: 10,
  images: [Ti.Filesystem.applicationDataDirectory  + 'appicon.png',
                Ti.Filesystem.applicationDataDirectory  + 'appicon.png',
                Ti.Filesystem.applicationDataDirectory  + 'appicon.png']
});

win2.add(image1);
win2.add(image2);

win2.open();

Comments

  1. Vishal Duggal 2014-12-22

    You need to start animation to view images Add this
       image2.start()
       
  2. Wilson Luu 2014-12-22

    Verified with both SDK 3.5.0.v20141222103320 and 3.4.1.GA that you need to call image2.start() in order to see the animation appear at the bottom of the window.
  3. Eric Merriman 2014-12-22

    Closing as invalid.

JSON Source