[AC-5219] iPhone X detection
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | n/a |
| Status | Resolved |
| Resolution | Done |
| Resolution Date | 2017-09-21T07:32:03.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | n/a |
| Reporter | Sebastian Klaus |
| Assignee | Hans Knöchel |
| Created | 2017-09-21T06:43:56.000+0000 |
| Updated | 2017-09-21T10:22:08.000+0000 |
Description
We need to detect use of an iPhone X.
Or is it possible now?
function isiPhoneX() { return (Ti.Platform.displayCaps.platformWidth === 375 && Ti.Platform.displayCaps.platformHeight == 812) || // Portrait (Ti.Platform.displayCaps.platformHeight === 812 && Ti.Platform.displayCaps.platformWidth == 375); // Landscape } Ti.API.info('Is iPhone X: ' + isiPhoneX());I tried that before, but with 667. 667 is what I'm getting when I compile an older project with 6.3.X. And this appears to me like that: https://cl.ly/1b1U0p0I121p
The issue is that your launch-screens need to match the new sizes. If you are using storyboards, it will adapt automatically, for the old legacy launch-images, you will need to wait until Apple unblocks TIMOB-25269.
Thanks!