I am using custom navbar for my project and I am using codes for ios 7 top margin as below;
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;
}
}
Alloy.Globals.Ios7TopMargin = _IsIos7Plus == true ? 20 : 0;
But iPhone X simulator shows 20 blank. Is there any way to detect iPhone X?


If you upgrade your project firstly you should check
[email protected]
[email protected]
splash screens are exists
Than you can detect iPhoneX code as below;
var IsIphoneX = (Ti.Platform.displayCaps.platformWidth === 375 && Ti.Platform.displayCaps.platformHeight === 812 && Ti.Platform.displayCaps.logicalDensityFactor === 3);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With