[TIMOB-13000] iOS: ImageView does not the trigger "load" event if touchEnabled is set to false
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-02-10T18:22:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.0.0 |
Components | iOS |
Labels | exalture, ios |
Reporter | Dan Tamas |
Assignee | Pedro Enrique |
Created | 2013-03-07T15:44:36.000+0000 |
Updated | 2015-03-10T17:49:04.000+0000 |
Description
An image won't trigger the load event if touchEnabled is set to false if the image property is set later (think custom caching or remote image)
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
win.open();
var img = Ti.UI.createImageView({
// image: 'http://thinkmobile.appcelerator.com/Portals/164416/images/appc_stacked.png?' + new Date().valueOf(),
touchEnabled:false
});
win.add(img);
img.addEventListener('load', function() {
alert('img loaded');
});
setTimeout(function(){
img.image = '/sample.jpg'
// img.image = 'http://thinkmobile.appcelerator.com/Portals/164416/images/appc_stacked.png?' + new Date().valueOf();
},1000);
It can be tested with both the attached image or the remote one.
In case the remote image is set in the constructor and the image is cached by Titanium (so no Date() at the end) the second time the app is opened will trigger, but this only because the image is already cached in the device by Ti.
The timeout simulates a custom caching where the images are grabbed on the device for offline usage.
Attachments
File | Date | Size |
---|---|---|
sample.jpg | 2013-03-07T15:44:36.000+0000 | 21886 |
Tested the scenario and found it valid.
Tried with sdk 3.2.0 in Nexus. Regardless of the value for touchEnabled, the load event is fired.
Why is this closed? The ticket is labeled **ios** and was tested on Nexus?
Invalid test. Ticked is labeled iOS yet tested on a Nexus.
Pending PR https://github.com/appcelerator/titanium_mobile/pull/4996
Verified fix on: Mac OSX 10.10.2 Appcelerator Studio, build: 4.0.0.201502171827 Titanium SDK build: 4.0.0.v20150306095010 Titanium CLI, build: 3.5.0-dev Alloy: 1.6.0-alpha Xcode 6.2 iPhone 6 (8.1) Using provided code built to device, when the image loads the load event is triggered. Closing ticket