在 TabBarController 内旋转 Three20 TTPhotoViewController

发布于 2024-12-06 17:14:22 字数 1309 浏览 0 评论 0原文

在空的 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: 我对 UITabBarControllerUINavigationController 进行了子类化以覆盖 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拿命拼未来 2024-12-13 17:14:22

我通过从 Window 对象中删除 TabBarController 奇怪地解决了我的问题,然后返回时将 TabBarController 添加到 window< /代码> 再次。

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.

咿呀咿呀哟 2024-12-13 17:14:22

你可以只旋转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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文