Skip to content

UIWindowSceneGeometryPreferencesIOS ​

UIWindowSceneGeometryPreferencesIOS 表示请求转屏时的偏好:想要哪几个方向。把它交给场景的 requestGeometryUpdateWithPreferences()。

继承关系:EventTarget → NSObject → UIWindowSceneGeometryPreferencesIOS

构造函数 ​

UIWindowSceneGeometryPreferencesIOS()

用一组方向名建偏好。

实例属性 ​

属性说明
interfaceOrientations想要的方向

示例 ​

js
const prefs = new UIWindowSceneGeometryPreferencesIOS(['landscapeRight']);
console.log(prefs.interfaceOrientations.join(','));

结果:输出 landscapeRight。

对应的 iOS API ​

UIWindowSceneGeometryPreferencesIOS。

参见 ​