[TIMOB-25504] -2436h@3x Images on iPhone X are not used when -736h@3x exists
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-13T20:59:18.000+0000 |
Affected Version/s | Release 6.3.0 |
Fix Version/s | Release 7.0.0 |
Components | iOS |
Labels | images, iphone, iphoneX |
Reporter | Thomas Neerup |
Assignee | Hans Knöchel |
Created | 2017-11-13T07:59:27.000+0000 |
Updated | 2017-11-13T21:33:15.000+0000 |
Description
When using image-2436h@3x.jpg images are not picked up when running on iPhone X if
an image-736h@3x.jpg exists.
It works fine with splash screens but not on other images.
The code below should be checking if running on iPhone X or iPhone 6/7 Plus and choose file accordingly.
if ([TiUtils isRetinaHDDisplay]) {
// first try -736h@3x iPhone 6 Plus specific
NSString *testpath = [NSString stringWithFormat:@"%@-736h@3x.%@",partial,ext];
if ([fm fileExistsAtPath:testpath]) {
return [NSURL fileURLWithPath:testpath];
}
// second try -2436h@3x iPhone X specific
testpath = [NSString stringWithFormat:@"%@-2436h@3x.%@", partial, ext];
if ([fm fileExistsAtPath:testpath]) {
return [NSURL fileURLWithPath:testpath];
}
// third try plain @3x
testpath = [NSString stringWithFormat:@"%@@3x.%@",partial,ext];
if ([fm fileExistsAtPath:testpath]) {
return [NSURL fileURLWithPath:testpath];
}
}
Attachments
File | Date | Size |
---|---|---|
iPhoneXTest.zip | 2017-11-13T08:46:33.000+0000 | 8337414 |
Hello [~thomas.neerup@eg.dk], Thanks for sharing with us. We are not clear about your issue. Are you using Appcerelerator Titanium or objective C? It would be better if you can share the complete test code and test case so that we can reproduce the issue on our end. Best
Hi Mostafizur I'm using Appcelerator studio.. The code included is from Github titanium_mobile/iphone/Classes/TiUtils.m and illustrates where I think the problem is. I'm just setting creating a Window with a backgroundImage and the wrong image is picked up by titanium..
Test case added.. When running on iPhone X I would expect the background image without the top border to be picked up... But the image with the border is picked up. I'm not using app thinning.
This is a valid issue! And sorry for not seeing that earlier. We'll provide a patch today and it will be part of the next release (7.0.0).
PR: https://github.com/appcelerator/titanium_mobile/pull/9592 Test-case: See the original tests in TIMOB-25269.
Verified in SDK build 7.0.0.v20171113113154