[AC-896] Android: imageView not trigger 'load' event if imageView was not added to the window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2015-06-26T23:03:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | imageView, load |
Reporter | Andrey Tkachenko |
Assignee | Shuo Liang |
Created | 2015-02-17T09:58:03.000+0000 |
Updated | 2016-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);
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.
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.