Rotating Three20 TTPhotoViewController inside TabBarController

Adding Three20 TTPhotoViewController on an empty UIWindow Rotation were working like a charm.

But when I moved the TTPhotoViewController to be created from UINavigationController inside a UITabBarController it does not rotate at all.

I made sure I return YES for every shouldAutorotateToInterfaceOrientation function.

Does Three20 Photo Gallery work in side UITabBarController with rotation?


How am I doing this?

[[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"]];


Update 1: after reading some posts I can now rotate the images only inside the TTScrollView but the navigation bar is not rotating.

Update 2: I have subclass-ed both UITabBarController and UINavigationController to override shouldAutorotateToInterfaceOrientation , but it did not help.


我通过从Window对象中移除TabBarController来解决我的问题,并且在返回时再次将TabBarController添加到window


You could just rotate the scrollView.. Anyway if you rotate the navController it would look weird when you pop the photoviewcontroller (if your gallery isn't rootViewController). I've rotated the scrollView and hided the navBar and bottom bar when going into landscape mode and it looks good.

链接地址: http://www.djcxy.com/p/9360.html

上一篇: 在JavaScript中,手动控制事件侦听器的顺序

下一篇: 在TabBarController中旋转Three20 TTPhotoViewController