草庐IT

uiinterfaceorientation

全部标签

ios - 在以不同方向呈现模态视图后保持父 View 的方向

所以我正在开发一个iPad应用程序,除了一个模态视图Controller外,它只支持横向模式。我遇到的问题是,一旦我呈现模态视图并将方向更改为纵向然后关闭View,父View(应该只支持横向)处于纵向模式,直到我旋转设备然后返回到景观并保持这种状态。我一直在折磨自己,试图弄清楚如何让parent看到原来的方向,但一直未能找到解决办法。我的应用程序委托(delegate)中有以下代码,仅允许在单个模态视图(GalleryPhotoViewer)上更改方向:-(NSUInteger)application:(UIApplication*)applicationsupportedInterf

ios - iPad Landscape 和 Portrait 具有 Size Class 的不同布局

如何使用Size类设计具有不同布局的iPad横向和纵​​向屏幕。对于两个方向,我只能找到w-regular和h-regular。示例:我需要使用SizeClass纵向对齐2个View,横向对齐2个View 最佳答案 终于找到了解决办法:iftraitCollection.verticalSizeClass==.Regular&&traitCollection.horizontalSizeClass==.Regular{varorientation:UIInterfaceOrientation=UIApplication.shared

ios - iPad Landscape 和 Portrait 具有 Size Class 的不同布局

如何使用Size类设计具有不同布局的iPad横向和纵​​向屏幕。对于两个方向,我只能找到w-regular和h-regular。示例:我需要使用SizeClass纵向对齐2个View,横向对齐2个View 最佳答案 终于找到了解决办法:iftraitCollection.verticalSizeClass==.Regular&&traitCollection.horizontalSizeClass==.Regular{varorientation:UIInterfaceOrientation=UIApplication.shared

ios - 为什么在 iOS 8 中我的应用程序在启动时采用了错误的方向?

我的应用程序在iOS7之前都能正常运行。我今天用Xcode6试了一下,当我运行它时,我有一个令人讨厌的惊喜:(:你可以看到Xcode现在绘制我的viewController就像它处于纵向模式一样,但正如你所看到的那样处于横向模式。你知道iOS8有什么变化吗?:/我使用了以下定向方法:(NSUInteger)supportedInterfaceOrientations(BOOL)应该自动旋转(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation编辑:我刚刚发现这个方

ios - 为什么在 iOS 8 中我的应用程序在启动时采用了错误的方向?

我的应用程序在iOS7之前都能正常运行。我今天用Xcode6试了一下,当我运行它时,我有一个令人讨厌的惊喜:(:你可以看到Xcode现在绘制我的viewController就像它处于纵向模式一样,但正如你所看到的那样处于横向模式。你知道iOS8有什么变化吗?:/我使用了以下定向方法:(NSUInteger)supportedInterfaceOrientations(BOOL)应该自动旋转(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation编辑:我刚刚发现这个方

ios - UIInterfaceOrientation、CGAffineTransform、Frame、Bounds 和 Center

有人可以指点我一本关于上述内容的入门读物吗?当你与其他人混在一起时,一个人会怎样?似乎无论我做什么,一旦我开始弄乱状态栏方向或View变换(即使我所做的只是90度旋转),我都可以指望我的View最终会横向,向上跌跌撞撞,在一个令人沮丧的下午尝试和错误试图让他们理顺。我敢肯定,一旦您了解了所有内容的逻辑和应用顺序,这一切就都说得通了,但到目前为止,根据经验,我还无法弄清楚。 最佳答案 我不知道关于该主题的优秀单一文档入门,但以下是我从经验和阅读文档中学到的内容。中心、边界和框架如果您设置框架,那么中心和边界将被更新。如果您设置中心或边

ios - 如果 UIInterfaceOrientation 横向值相同,我应该如何确定横向 View 的方向?

我想呈现一个响应方向变化的View,但由于各种原因无法使用iOS的内置自动旋转。在viewDidLoad中,我使用当前方向来确定View的初始布局:_originalOrientation=[UIDevicecurrentDevice].orientation;//ifwewerelaunchedflatorunknown,usethestatusbarorientationasaguideif(_originalOrientation==UIDeviceOrientationUnknown||_originalOrientation==UIDeviceOrientationFaceD

iphone - iOS 6 的多个 UIInterfaceOrientations 应用程序

我在尝试从iOS6设置新的UIInterfaceOrientations时遇到了麻烦。恢复我的应用:我的应用有很多View;几乎每个View都应以纵向显示;我的2个View(使用MPMoviePlayerViewController播放视频的View)应该向左、向右和纵向旋转。我最初的想法是将应用支持的方向设置为纵向,然后更改(不知道如何)从视频播放器View支持的方向。处理此问题的最佳方法是什么?提前致谢! 最佳答案 通过将SupportedInterfaceOrientations设置为我需要的所有内容(纵向、左右横向)并添加U

iphone - iOS:初始界面方向 [UIInterfaceOrientation] 在 plist 中被忽略

我正在尝试将我的应用程序的初始方向设置为UIInterfaceOrientationLandscapeLeft我买不到'Initialinterfaceorientation'[UIInterfaceOrientation]覆盖数组中的第一项'Supportedinterfaceorientations'[UISupportedInterfaceOrientations]我注意到一个iPhone应用程序总是以“纵向(底部主页按钮)”开头。数组是:'Supportedinterfaceorientations'[UISupportedInterfaceOrientations]Portr

ios - 从枚举类型 'enum UIDeviceOrientation' 隐式转换为不同的枚举类型 'UIInterfaceOrientation' 'enum UIInterfaceOrientation

我正在使用Xcode5.0.2并在尝试编译我的Objective-C代码时收到以下警告:Implicitconversionfromenumerationtype'enumUIDeviceOrientation'todifferentenumerationtype'UIInterfaceOrientation'(aka'enumUIInterfaceOrientation')警告在viewController.m中-(void)youTubeStarted:(NSNotification*)notification{//yourcodehereNSLog(@"youTubeStarte