Tag: uiinterfaceorientation

UIInterfaceOrientation —仅在将应用设置为纵向模式时如何更改方向?

如今,大多数应用程序都基于纵向模式。 例如,来自客户端的要求是某个屏幕需要处于横向模式。 那怎么办呢? 并覆盖supportedInterfaceOrientationsFor,如下所示: 然后在您要在其中切换方向的控制器中。 编写以下函数: 最后,在您的viewDidAppear和viewDidDisappear中 : 运行并测试您的应用。 它应该工作正常。 特别感谢我们的团队成员Muhammad Raza为此开发了一个示例应用程序。 您可以在此处的链接中查看。 如果您有任何疑问,请随时将其放在下面的评论部分。 平安了!

IOS iPad应用底部奇怪的白色区域

我开发了iPad tabbar应用程序。 我也使用左侧的自定义选项卡。 Bu标签栏在横向模式下还有沿着边缘的白色背景,还有纵向模式。 这个区域不能删除任何方法。

iPad应用程序界面方向在启动应用程序后已更改

我正在应用程序。 应用程序的方向是风景,但应用程序运行后,应用程序的界面方向改变界面和旋转。 启动屏幕以正确的方式显示(横向)。 我使用ios7的应用程序是代码为ios5我认为有一些不赞成的API问题,例如shouldAutorotateToInterfaceOrientation机器人调用,因为这是没有更多的最新ios

使用objective-c以编程方式颠倒iOS应用程序

我想在ViewController中使用下面的代码来颠倒我的应用程序: – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { //return NO; // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationMaskPortraitUpsideDown); } – (UIInterfaceOrientationMask) supportedInterfaceOrientations { return [super supportedInterfaceOrientations] | UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskPortrait; } 在AppDelegate中: – (UIInterfaceOrientationMask) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskPortrait; } 当用户按下一个button NSNumber * value = [NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown]; [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; 该应用程序不知何故不旋转,我不知道为什么。 有人可以提供一个提示? […]

在iOS上,为什么shouldAutorotateToInterfaceOrientation调用了10,12或13次?

如果为iPad创build单一视图应用程序,根据为plist设置支持的设备方向,以及shouldAutorotateToInterfaceOrientation返回的值, shouldAutorotateToInterfaceOrientation可以调用10,12或甚至13次。 一个简单的例子是,如果“Support Device Orientation”设置为“Landscape Left”,并且shouldAutorotateToInterfaceOrientation也仅对Landscape Left返回YES ,那么如果我以Landscape Left方向启动应用程序,那么shouldAutorotateToInterfaceOrientation将连续调用12次。 如果我拿着它在其他方向,并启动应用程序,那么它是13倍。 连续几次被称为什么原因?

你如何判断UIImagePickerController cameraOverlayview是否会旋转?

Ipad上的IOS 6在横向模式下旋转UIImagePickerController cameraOverlayView,但iPhone 3GS上的IOS 6没有 – 谢谢苹果! 我不知道IOS 5或其他设备的行为,所以有没有一种方法来预测这种行为,所以我可以在覆盖视图上应用旋转变换? 谢谢

应用程序由于InterfaceOrientation而崩溃

我的应用程序是基于Landscape 。 应用在我的设备上运行时,该应用立即崩溃。 我select了这两个领域 UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight 我得到这个错误: 由于未捕获exception而终止应用程序UIApplicationInvalidInterfaceOrientation,原因:支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES

Xcode 5中的横向和纵向自定义button

我已经在Xcode 5创build自定义button。在纵向视图黄色button将不得不显示和横向模式蓝色button将不得不display.my代码如下: -(BOOL)shouldAutorotate { UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIInterfaceOrientationPortrait) { [self addYellowBtn1]; } else if(orientation == UIInterfaceOrientationLandscapeRight) { [self addLightBlueBtn2]; } return YES; } 当我运行这个应用程序,在第一个肖像视图显示黄色button.but当我改变成风景两个button都显示。任何人都可以帮助我吗?

在iPad上的UIInterfaceOrientation期间更改UIViews

我正在尝试改变旋转的观点,因为我的观点必须从纵向到横向显着不同。 现在,我正在使用的代码工作一次,然后应用程序冻结时试图回旋。 无论哪个方向都没有什么区别。 例如:如果我在景观和旋转肖像一切都很好,直到我旋转回景观,然后冻结,没有任何东西。 这是我用来实现这个的代码 在我的“viewDidLoad”方法 [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; 然后我把这个叫做轮换: – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } – (void)didRotate:(NSNotification *)notification { UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; if ((orientation == UIDeviceOrientationLandscapeLeft) || (orientation == UIDeviceOrientationLandscapeLeft)) { // present the other viewController, it's only viewable […]

在一个视图控制器强制肖像使其他人最初在肖像

导航控制器的根视图控制器只支持纵向方向,其他控制器支持所有的方向。现在,如果我在根视图控制器和设备在横向,如果我推动下一个视图控制器打开纵向应打开在横向它支持所有的方向。 请帮我解决一下这个。 使用iPhone 4s iOS6.1.3