Unity跨平台技术分享Unity技术分享Unity 3D 学习笔记

Unity iOS包iPhoneX home键变灰 二次点击激活

2018-08-22  本文已影响4人  RichMartin

需要修改xcode工程下Unity引擎脚本Classes/UI/UnityViewControllerBase+iOS.mm

- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures
{
    UIRectEdge res = UIRectEdgeNone;
    if (UnityGetDeferSystemGesturesTopEdge())
        res |= UIRectEdgeTop;
    if (UnityGetDeferSystemGesturesBottomEdge())
        res |= UIRectEdgeBottom;
    if (UnityGetDeferSystemGesturesLeftEdge())
        res |= UIRectEdgeLeft;
    if (UnityGetDeferSystemGesturesRightEdge())
        res |= UIRectEdgeRight;
    return UIRectEdgeAll; 

}

修改为

- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures
{
    return UIRectEdgeAll;
}

如果有prefersHomeIndicatorAutoHidden方法 直接删除prefersHomeIndicatorAutoHidden方法

上一篇 下一篇

猜你喜欢

热点阅读