在 TabBarController 内旋转 Three20 TTPhotoViewController
在空的 UIWindow
上添加 Three20 TTPhotoViewController 旋转工作就像魅力。
但是,当我将要从 UINavigationController
创建的 TTPhotoViewController 移动到 UITabBarController
内时,它根本不旋转。
我确保对每个 shouldAutorotateToInterfaceOrientation
函数都返回 YES。
Three20 照片库是否可以在侧 UITabBarController 中旋转并工作?
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.更新 2: 我对 UITabBarController
和 UINavigationController
进行了子类化以覆盖 shouldAutorotateToInterfaceOrientation
,但它没有帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过从
Window
对象中删除TabBarController
奇怪地解决了我的问题,然后返回时将TabBarController
添加到window< /代码> 再次。
I have weirdly solved my issue by removing the
TabBarController
from theWindow
object and when going back I add theTabBarController
to thewindow
again.你可以只旋转scrollView..无论如何,如果你旋转navController,当你弹出photoviewcontroller时它会看起来很奇怪(如果你的画廊不是rootViewController)。当进入横向模式时,我旋转了滚动视图并隐藏了导航栏和底部栏,它看起来不错。
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.