Titanium JIRA Archive
Appcelerator Community (AC)

[AC-896] Android: imageView not trigger 'load' event if imageView was not added to the window

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2015-06-26T23:03:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsimageView, load
ReporterAndrey Tkachenko
AssigneeShuo Liang
Created2015-02-17T09:58:03.000+0000
Updated2016-03-08T07:37:12.000+0000

Description

var image = Ti.UI.createImageView({image:"http://..."});
   
function saveImage(e) {            
    image.removeEventListener('load', saveImage);
    Ti.API.info('>>> image loaded');
}

image.addEventListener('load', saveImage);

Comments

  1. Shuo Liang 2015-04-07

    HI Andrey, This is normal behaviour. If you do not add the imageView to window, that means you only define it, but never use it. That why "load" event not load. Otherwise, the imageView will cost memory to load it but you never use it. It just waste memory.
  2. Andrey Tkachenko 2015-04-07

    I use it to manipulate image (usually in the commonjs module). It is normal behavior for developer. Then add final image to the target window. Now I have to create temporary window that overflow top of my UI with breaking user interaction some seconds and blink artefacts of show/hide top level window.

JSON Source