objective-c - TSAlertView 启用设备旋转

标签 objective-c ios rotation uialertview

因为我需要一个更自定义的 UIAlertView,所以我正在使用。我的问题是它可以使设备向任何方向旋转,即使我禁用了它也是如此。

在 AlertView 出现之前,横向模式被停用,但是当我调用 show 时,任何方向都是可能的。

这是怎么回事?我在 UIAlertView 中没有这种行为。

最佳答案

转到@implementation TSAlertViewController 并检查shouldAutorotateToInterfaceOrientation

@implementation TSAlertViewController
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return NO;
}

关于objective-c - TSAlertView 启用设备旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8541144/

相关文章:

three.js - 如何在 Three.js 中围绕组的中心旋转

ios - UISearchBar 显示错误 : text too far left, 与放大镜图标重叠

ios - Swift UIView 从堆栈 View 中消失

iOS:设备旋转后如何运行功能(Swift)

matlab - 这个旋转矩阵(关于向量的角度)是否仅限于某些方向?

iOS自动布局多个高度

objective-c - 适用于 iPhone Retina 4 英寸 64 位的 xcode 5 上的 Dropbox SDK

ios - 应用程序未运行时,Objective-C IOS 7 推送通知保存数据?

objective-c - tabBarController 中的一个选项卡有两个 ViewController

android - React Native博览会上传:ios issue