I want to know the dimensions of the home indicator bar for iPhone X / XR / Xmax. Is there any way to get those constants? Thanks!
I was looking for this today, not as a coding stand point but design. I do not know of an Apple public or private API that allows to get this information. I can't think of a coding situation where i would need it.:)
The Home indicator safe area is 34pts and the total including the Tab Bar, if any, is 83pts (Apple HIG).
I have calculated this myself using photoshop and pixel accurate representation of a iPhone Xs max and Xs views.
- Below the Home indicator -> 8pts
- Home indicator height -> 5pts
- Home indicator width -> Xs Max = 148pts & Xs = 134pts
I know the post is about 8 months old, but this was google top 5 search results. Hope it serves someone.
There's a hack you can do, and it doens't exactly give you the height of the home indicator, but it does give the exact bounds (and height) of the area around the home indicator (which in many use cases people need this). Create a dummy view, constraint the bottom to the bottom of the screen, and its top to the main view
's safe area layout guide's bottom. Wait for the view to be drawn, and get its frame
property's height
.
© 2022 - 2024 — McMap. All rights reserved.