Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
iPhone portrait mode detecting the notch.
-
Hi, is there a way I can detect the notch that is used on the newer versions of the iPhone?
For example if the phone has the notch I will add some different CSS than if the phone doesn’t have it.
Thanks in advance.
-
PS, I should have mention I only need portrait mode.
-
How about
ons.platform.isIPhoneX
?https://onsen.io/v2/api/vue/$ons.platform.html#method-isIPhoneX
Contrary to the naming, this will return true for iPhone X, XS, XS Max, XR, 11, 11 Pro, 11 Pro Max, 12 Mini, 12, 12 Pro or 12 Pro Max.
-
@emccorson said in iPhone portrait mode detecting the notch.:
How about
ons.platform.isIPhoneX
?https://onsen.io/v2/api/vue/$ons.platform.html#method-isIPhoneX mapquest driving directions
Contrary to the naming, this will return true for iPhone X, XS, XS Max, XR, 11, 11 Pro, 11 Pro Max, 12 Mini, 12, 12 Pro or 12 Pro Max.
Hi @emccorson , Are you able tell me how you did this please?