How can I get the size (width, height) of the iPhone X home indicator?

喜欢而已 提交于 2020-12-09 09:47:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!