iPhone X 在视图控制器上隐藏主页指示器 [英] iPhone X hide home indicator on view controller

查看:31
本文介绍了iPhone X 在视图控制器上隐藏主页指示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从上到下占据整个屏幕的视图控制器.我想隐藏 iPhone X 设备屏幕底部的主页栏指示器.

I have a view controller that takes up the whole screen from top to bottom. I would like to hide the home bar indicator on the bottom of the screen on iPhone X devices.

如何在 iOS 11 中执行此操作?

How can I do this in iOS 11?

推荐答案

你应该在你的视图控制器中重写 prefersHomeIndicatorAutoHidden 来实现:

You should override prefersHomeIndicatorAutoHidden in your view controller to achieve that:

override var prefersHomeIndicatorAutoHidden: Bool {
    return true
}

这篇关于iPhone X 在视图控制器上隐藏主页指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆