在 Simulator for tvOS 应用程序中旋转显示
rotate display in Simulator for tvOS app
我有一个将部署到 tvOS 的 React 本机应用程序。目前,我正在借助 Apple Simulator
进行构建。
它卡在横向模式,而要部署到的电视是纵向模式。
虽然我无法将模拟器旋转到纵向模式,但我卡住了。我花了一个小时左右的时间在谷歌上搜索,但找不到如何旋转我的 tvOS 应用程序的答案。该选项在 Hardware > Rotate Left
中,但显示为灰色。
如何将我的 tvOS 应用旋转 90 度?
至少到目前为止,tvOS 10.2。 AppleTv 仅支持横向。
如您所见,UIDeviceOrientation 的定义被标记为 __TVOS_PROHIBITED
typedef NS_ENUM(NSInteger, UIDeviceOrientation) {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // Device oriented vertically, home button on the bottom
UIDeviceOrientationPortraitUpsideDown, // Device oriented vertically, home button on the top
UIDeviceOrientationLandscapeLeft, // Device oriented horizontally, home button on the right
UIDeviceOrientationLandscapeRight, // Device oriented horizontally, home button on the left
UIDeviceOrientationFaceUp, // Device oriented flat, face up
UIDeviceOrientationFaceDown // Device oriented flat, face down
} __TVOS_PROHIBITED;
我有一个将部署到 tvOS 的 React 本机应用程序。目前,我正在借助 Apple Simulator
进行构建。
它卡在横向模式,而要部署到的电视是纵向模式。
虽然我无法将模拟器旋转到纵向模式,但我卡住了。我花了一个小时左右的时间在谷歌上搜索,但找不到如何旋转我的 tvOS 应用程序的答案。该选项在 Hardware > Rotate Left
中,但显示为灰色。
如何将我的 tvOS 应用旋转 90 度?
至少到目前为止,tvOS 10.2。 AppleTv 仅支持横向。
如您所见,UIDeviceOrientation 的定义被标记为 __TVOS_PROHIBITED
typedef NS_ENUM(NSInteger, UIDeviceOrientation) {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // Device oriented vertically, home button on the bottom
UIDeviceOrientationPortraitUpsideDown, // Device oriented vertically, home button on the top
UIDeviceOrientationLandscapeLeft, // Device oriented horizontally, home button on the right
UIDeviceOrientationLandscapeRight, // Device oriented horizontally, home button on the left
UIDeviceOrientationFaceUp, // Device oriented flat, face up
UIDeviceOrientationFaceDown // Device oriented flat, face down
} __TVOS_PROHIBITED;