[AC-5638] Detect iPhone X with Appcelerator
GitHub Issue | n/a |
Type | Improvement |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2018-03-02T18:31:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | ios, iphone, x |
Reporter | Kerberos |
Assignee | Shak Hossain |
Created | 2018-03-02T14:10:48.000+0000 |
Updated | 2018-03-05T10:06:41.000+0000 |
Description
I am using custom navbar for my project and I am using codes for ios 7 top margin as below;
{noformat}
var _IsIos7Plus = false;
if (Titanium.Platform.name == 'iPhone OS') {
var _Version = Titanium.Platform.version.split(".");
var _Major = parseInt(_Version[0], 10);
if (_Major >= 7) {
_IsIos7Plus = true;
}
}
{noformat}
Alloy.Globals.Ios7TopMargin = _IsIos7Plus == true ? 20 : 0;
Attachments
File | Date | Size |
Snap1.jpg | 2018-03-02T14:10:33.000+0000 | 11621 |
Snap2.jpg | 2018-03-02T14:10:33.000+0000 | 10622 |
[~Kerbooo] You can use the following to determine if a device is iPhone X
For example, https://github.com/hansemannn/studentenfutter-app/blob/master/app/alloy.js#L4 Also see AC-5219
I tested it simulator but does not work. Because Ti.Platform.displayCaps.platformHeight gives 667
[~Kerbooo] Check the comments on AC-5219
It shows the overall wrong size because you are missing the correct launch-screens. See [the docs](http://docs.appcelerator.com/platform/latest/#!/guide/Icons_and_Splash_Screens-section-src-29004897_IconsandSplashScreens-iOSgraphicassetrequirementsandoptions) for details: - Default-Portrait-2436h@3x.png - Default-Landscape-2436h@3x.png - OR: Storyboards (recommended by Apple these days, also reduces app-size by ~ 2-4mb)
Thank you very much for your support. I have edit (updated) my splah screens it works.