新的iPhone X已经摆脱了主页按钮,并在底部用一个“家用指示器”代替它,允许用户向上滑动以返回到主屏幕。如何检测iPhone X家庭指示灯?
我的问题是,我们如何检测这个家庭指标是否在屏幕上?我想做类似的事情:
if (!notfullScreen)
{
if (swipeBarExists)
{
viewHeight -= swipeBarHeight;
}
}
我登记了[UIApplication sharedApplication]
,什么也没找到。基本上我不知道该怎么称呼这件事,并且无法找到答案。
看看safeAreaInsets,其中包含屏幕的这个区域所占用的空间 –
Apple似乎很清楚我们不应该这样写代码。看看https://developer.apple.com/videos/play/fall2017/801/ –
@Ser Pounce我没有在这方面的工作,但下面的链接可能是有用的https://medium.com/the-traveled- ios-developers-guide/iphone-x-handling-with-home-indicator-2e8e47f5647f –