[AC-1355] 3.5.0.GA No longer uses Retina images with image from string
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2015-01-26T20:48:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | 3.5.0, @2ximages, retina |
Reporter | Hilko Lantinga |
Assignee | Mauro Parra-Miranda |
Created | 2015-01-19T21:37:38.000+0000 |
Updated | 2016-03-08T07:37:46.000+0000 |
Description
The only way to load Retina images with a string on 3.5.0 is with something like:
if (density === 'high') {
image = image.replace('.jpg', '@2x.jpg');
image = image.replace('.png', '@2x.png');
}
imageView = Ti.UI.createImageView({
top : 1,
left : 1,
backgroundImage : Ti.Filesystem.applicationDataDirectory + image
});
With 3.4.1 it works without inserting @2x in to the string.
Attachments
File | Date | Size |
---|---|---|
image.png | 2015-01-26T20:46:54.000+0000 | 798136 |
image@2x.png | 2015-01-26T20:46:54.000+0000 | 2264946 |
Hello, we can't reproduce your issue. How to test it? 1. Create a new mobile project classic titanium 2. Copy the image.png and image@2x.png attached to the ticket, copy it to the Resources Directory 3. Replace app.js to:
4. Run it in a retina device. You will see that the image being shown is the image@2x.png, as expected.
I'm not loading them from Resources, but from the application data directory (images are downloaded from http server first).