【问题标题】:Rotating Three20 TTPhotoViewController inside TabBarController在 TabBarController 中旋转 Three20 Photo ViewController
【发布时间】:2011-09-27 09:53:40
【问题描述】:

在一个空的UIWindow 上添加Three20 TTPhotoViewController 旋转就像一个魅力。

但是当我将 TTPhotoViewControllerUINavigationController 创建到 UITabBarController 中时,它根本不会旋转。

我确保为每个 shouldAutorotateToInterfaceOrientation 函数返回 YES

Three20 Photo Gallery 是否可以在带有旋转的 UITabBarController 侧工作?


我是怎么做到的?
[[TTURLRequestQueue mainQueue] setMaxContentLength:0];

TTNavigator *navigator = [TTNavigator navigator];
navigator.persistenceMode = TTNavigatorPersistenceModeAll;

navigator.window = [UIApplication sharedApplication].keyWindow;
TTURLMap *map = navigator.URLMap;
[map from:@"tt://appPhotos" toSharedViewController:[PhotoViewController class]];
[navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://appPhotos"]];


更新 1: 在阅读了一些帖子后,我现在只能在 TTScrollView 内旋转图像,但导航栏没有旋转。

更新 2: 我已经对UITabBarControllerUINavigationController 进行了子类化以覆盖shouldAutorotateToInterfaceOrientation,但这没有帮助。

【问题讨论】:

    标签: objective-c rotation three20


    【解决方案1】:

    我奇怪地解决了我的问题,方法是从 Window 对象中删除 TabBarController,然后在返回时将 TabBarController 再次添加到 window

    【讨论】:

      【解决方案2】:

      你可以只旋转scrollView。无论如何,如果你旋转navController,当你弹出photoviewcontroller(如果你的画廊不是rootViewController)时,它会看起来很奇怪。进入横向模式时,我旋转了滚动视图并隐藏了导航栏和底栏,看起来不错。

      【讨论】:

      • 非常好的主意,我没有考虑隐藏导航栏就达到了这个解决方案,正如你所说,如果你不隐藏导航栏看起来很奇怪,但我的解决方案非常完美,我没有触及Three20 图书馆。
      猜你喜欢
      • 1970-01-01
      • 2011-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-22
      • 1970-01-01
      • 2012-09-13
      • 2015-03-30
      相关资源
      最近更新 更多