【问题标题】:SoundCloud Cocoa Auth Popup Modal is in Portrait while UIViewController is landscapeSoundCloud Cocoa Auth Popup Modal 是纵向的,而 UIViewController 是横向的
【发布时间】:2012-06-09 22:00:50
【问题描述】:

我正在将 SoundCloud 集成到我的 iOS 5 应用程序中,但是当我调用 [scAPI checkAuthentication] 时,弹出模式以纵向模式出现,而我的 UIViewController 处于横向模式。这非常奇怪,因为对于同一个 UIViewController,我有一个正确显示的邮件组合模式;同样,转换到另一个正确显示的 UIViewController。

我不确定该怎么做,我一直在寻找网络和(SoundCloud)源代码以找到解决方案,但到目前为止还没有运气。

更新: 这是使用Cocoa API Wrapper from SoundCloud

【问题讨论】:

    标签: objective-c ios cocoa soundcloud


    【解决方案1】:

    我创建了自己的 hack-ish 解决方案。在 Sources 下的 SoundCloudAPI 目录中,在文件 SCLoginViewController.m 中,我在该文件中添加了以下方法:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation {
        return UIInterfaceOrientationIsLandscape(orientation);
    }
    

    这是在 UIViewController 中强制横向模式的标准实现。我想如果有人想保持方向动态,他们总是可以从 rootViewController 获取 interfaceOrientation。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多