Problem
ImageView error event not working with local files. If the image is remote image file the error event it will be executed accordingly.
Tested on
iOS simulator 4.3 & 5.1
Repro sequence
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win1.add(label1);
win1.open();
var img = Ti.UI.createImageView({
// First run.- Attempting to load a remote image file
image:'http://files.daddyhunt.com/sites/default/files/imagecache/mangrid-212/photos/z/z/z/277606/Photo_on_2010-09-14_at_13.14_3.jpg'
// Second run.- Attempting to load a local image file
//image: 'KS_na_ui.png'
});
win1.add(img);
img.addEventListener('error', function(e){
label1.text = e.image + "image loading properly got an error!";
img.image = 'KS_nav_ui.png';//loading alternative image
});
@Hazem Khaled Can you paste logs from 1.8.2 & 2.x SDKs here please? Furthermore, what are the iOS versions and devices/simulators that this was tested on?
Closing due to inactivity.
worked with me on OS 4.2 with any SDK, but not work OS 5.0 2.0.2 OS 5.0 log
1.8
Thanks
Couldn't reproduce the issue as per sample you provided us. Furthermore, if I run code below starting from 1.8.2 to 2.1.0 CI SDKs will see the same output/behavior. - app.js
after more check with 2.0 & 2.1 it don't work on error working only fired if http link get error, but if wrong local file it don't work (not working)
(working)
Moving to Titanium Mobile project to dig into it. Added the labels, updated the test case and issue description.
imgaeView have events like (load & error), they will not fired with local files, only fired with remote files working
not working
only working with local files on Android when send it as blob data the solution (Android only) (load event only)
Thanks
issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0