Version: 2023.2
public static bool hideHomeButton ;

描述

指定是否应在此应用程序的 iOS 版本中隐藏主屏幕按钮。

在 iPhone X 上,主屏幕按钮以系统手势(从屏幕的下边缘向上滑动)的形式实现。 此虚拟按钮的位置由白色条表示。 如果启用了此设置,只要用户几秒钟没有触摸屏幕,主屏幕按钮就会隐藏在视图中。 请注意,iOS 人机界面指南不建议为不包含被动观看体验(例如观看视频或照片幻灯片放映)的应用程序启用此行为。 可以通过更改 iOS.Device.hideHomeButton 属性在运行时隐藏主屏幕按钮。

                        
using UnityEngine;
using UnityEditor;

public class HideHomeButtonExample { // This example will create a Menu Item called "Hide Home Button" under "Examples" submenu which when pressed will print the current value of hideHomeButton to console and then change it to "true" [MenuItem("Examples/Hide Home Button")] public static void SimpleExample() { // This will print the value of "Hide Home Button" property for iOS (in "Project Settings/Player/Other Settings") to the console Debug.Log("Hide Home Button : " + PlayerSettings.iOS.hideHomeButton); // This will enable the "Hide Home Button" property for iOS (in "Project Settings/Player/Other Settings") PlayerSettings.iOS.hideHomeButton = true; } }