草庐IT

InterfaceOrientation

全部标签

ios - 阻止 UIView 旋转到横向

我在导航Controller中有一个UIView,我试图阻止此View进入Landscape但是我尝试使用的方法永远不会触发。代码低于任何帮助将不胜感激。-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{if(interfaceOrientation==UIInterfaceOrientationLandscapeRight){returnNO;}elseif(interfaceOrientation==UIInterfaceOrientationLand

iphone - 改变 iPad 方向时 Xcode 4.5 的问题

自从我升级到XCODE4.5后,我就面临这个问题。我有各种UI元素UIButton*button1;UIButton*按钮2;UIButton*button3;-(void)viewDidLoad{button1=[[UIButtonalloc]init];button1.backgroundColor=[UIColoryellowColor];[self.viewaddSubview:button1];button2=[[UIButtonalloc]init];button2.backgroundColor=[UIColoryellowColor];[self.viewaddSubv

iphone - 在方向更改时正确自动调整所有 UIScrollView subview 的大小

我有:底部有1个分页ScrollView(如面板),最初为768x100像素,当iPad旋转到横向时,它被设置为拉伸(stretch)到1024。2个subview,每个大小为768x100像素;一个在原点0,0,一个在原点768,0。在纵向模式下,用户可以左右滑动以在这些面板之间切换。当我旋转到横向时,即使自动调整大小正确,subview仍保持相同大小。它们也保持在同一位置,这意味着右侧Pane现在出现在距右侧“in”256像素的位置。有没有办法使用自动调整来解决这个问题?我必须手动调整旋转的subview吗? 最佳答案 如果界面

ios - 模态视图 Controller 在 iOS 5.1 中旋转不正确,而不是在 5.0 中

我有一个横向的主视图Controller(整个应用程序是横向的左/右)。该主视图使用以下方式呈现模态视图:ModalViewController*modalVC=[[ModalViewControlleralloc]init];[modalVCsetModalTransitionStyle:UIModalTransitionStyleCrossDissolve];[selfpresentModalViewController:modalVCanimated:YES];在iOS5.0*中,这完全符合我的预期,主视图是横向的,模态视图是横向的。在iOS5.1中,主视图立即向左旋转90º,然

ios - GameCenter 横向模式在 iPad 上不起作用

谁能给我解释一下这是怎么回事?我用这个方法-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{return(UIInterfaceOrientationIsLandscape(interfaceOrientation));}为matchmakerViewController提供横向方向。它可以在iPhone甚至iPad模拟器上完美运行,但不能在iPad设备上运行。当我在iPad上运行应用程序时,matchmakerViewController莫名其妙地出现在

iphone - 启用 iPhone 界面方向

我试图让我的应用程序在设备本身旋转时旋转界面,但我做不到。我在plist信息文件中添加了支持的接口(interface),并为shouldRotateToInterfaceOrientation返回了yes。-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{if(interfaceOrientation==UIInterfaceOrientationPortrait||interfaceOrientation==UIInterfaceOrientation

iOS 6 旋转 : Pushing a View Controller

我想支持iOS6轮换。问题是,我一直在查看大量文档和堆栈溢出问题,但没有找到任何稍微深入的解决方案。我只看到我应该将这两个方法添加到我的ViewController类中-但是,如果我没记错的话,它们的操作方式与iOS6之前的方法不同:-(BOOL)shouldAutorotate{returnYES;}-(NSUInteger)supportedInterfaceOrientations{returnUIInterfaceOrientationMaskAll;//usewhatisappropriateforyou.}我的应用目前使用以下代码在iOS6之前的版本中轮换。请注意,我使用界

ios - 如何知道 iOS 8 扩展中的当前 interfaceOrientation?

UIViewController的InterfaceOrientation已弃用,文档建议使用[[UIApplicationsharedApplication]statusBarOrientation],但iOS8的扩展中没有sharedApplication。正如@Retro提到的,在大多数情况下,您可以在UIViewController中使用self.traitCollection.verticalSizeClass或self.traitCollection.horizo​​ntalSizeClass来获取方向信息。 最佳答案

iphone - 查看旋转通知 : why didRotateFromInterfaceOrientation: doesn't get called?

我正在尝试检测任何设备方向变化,以便我可以更新View。无论方向是纵向还是横向,我都想更新View,所以我实现了这个方法:-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{//ReturnYESforsupportedorientations.return(interfaceOrientation==UIInterfaceOrientationPortrait||interfaceOrientation==UIInterfaceOrientationLan

iphone - 查看旋转通知 : why didRotateFromInterfaceOrientation: doesn't get called?

我正在尝试检测任何设备方向变化,以便我可以更新View。无论方向是纵向还是横向,我都想更新View,所以我实现了这个方法:-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{//ReturnYESforsupportedorientations.return(interfaceOrientation==UIInterfaceOrientationPortrait||interfaceOrientation==UIInterfaceOrientationLan