Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 854
Ahmad Kayyali Avatar asked Sep 27 '11 09:09

Ahmad Kayyali


1 Answers

I have weirdly solved my issue by removing the TabBarController from the Window object and when going back I add the TabBarController to the window again.

like image 145
Ahmad Kayyali Avatar answered Oct 20 '22 23:10

Ahmad Kayyali