问题
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!
回答1:
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.
来源:https://stackoverflow.com/questions/53109069/how-can-i-get-the-size-width-height-of-the-iphone-x-home-indicator