Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 772897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:52:37+00:00 2026-05-14T18:52:37+00:00

Here is a flow that I can not figure out how to work. (

  • 0

Here is a flow that I can not figure out how to work. ( when I state (working) it means that in that current state the rules for orientation for that view are working correctly)

First View: TableView on the stack of a UINavigationController that is a tab of UITabBarController.

TableView is only allowed to be portrait. (working)
When you rotate the TableView to landscape a modal comes up with a custom UIView that is like a coverflow (which i’ll explain the problem there in a moment).

A Selection made on tableview pushes a UIScrollview on to the stack.

UIScrollView is allowed all orientations. (working)

When UIScrollView is in landscape mode and the user hits back they are taken to the custom UIView that is like the coverflow and only allows landscape.

The problem is here. Because the UIScrollView allows full rotation it permitted the TableView to rotate as well to landscape.

I have a method attached to a notification “UIDeviceOrientationDidChangeNotification” that checks to see if the custom view is the current controller and if it is and if the user has rotated back to portrait I need to pop the custom view and show the table view.

The table view has to rotate back to portrait, which really is okay as long as the user doesn’t see it. When I create custom animations it works pretty good except for some odd invisible black box that seems to rotate with the device right before I fade out the customview to the tableview.

Further inorder to ensure that my tableview will rotate to portrait I have to allow the customview to support all orientations because the system looks to the current view (in my code) as to whether or not that app is allowed to rotate to a certain orientation. Because of this I many proposed solutions will show the customview rotating to portrait as the table view comes back to focus.

My other problem is very similar. If you are viewing the tableview and rotate the modalview of the customview is presented. When you make a selection on this view it pushes the UIScrollview onto the stack, but because the Tableview only supports portrait the UIScrollview comes in in portrait while the device is in landscape mode.

How can I overcome these awful blocks?

This is my current attempt:

When it comes to working with UITabBarController the system really only cares what the tabbarcontroller has to say about rotation.

Currently whenever a view loads it reports it supported orientations.

TabBarController.m

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
switch (self.supportedOrientation) {
    case SupportPortraitOrientation:
        [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; 
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
        break;
    case SupportPortraitUpsideDownOrientation:
        [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; 
        return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
        break;
    case SupportPortraitAllOrientation:
        [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; 
        return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
        break;
    case SupportLandscapeLeftOrientation:
        [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; 
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
        break;
    case SupportLandscapeRightOrienation:
        [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];            
        return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
        break;
    case SupportLandscapeAllOrientation:
        [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; 
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
        break;
    case SupportAllOrientation:
        if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
            [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; 
        }else {
            //[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; 
        }
        return YES;
        break;
    default:
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
        break;
    }

}

This block of code is part of my UINavigationController and is in a method that responds to the UIDeviceOrientationDidChangeNotification Notification. It is responsible for poping the customview and showing the tableview. There are two different versions in place that originally were for two different versions of the SDK but both are pretty close to solutions.

The reason the first is not supported on 3.0 is for some reason you can’t have a view showing and then showen as a modal view. Not sure if that is a bug or a feature.

The second solution works pretty good except that I see an outer box rotating around the iphone.

if ([[self topViewController] isKindOfClass:FlowViewController.class]) {
    NSString *iphoneVersion = [[UIDevice currentDevice] systemVersion];
    double version = [iphoneVersion doubleValue];
    if(version > 3.0){ //1st solution
        //if the delivered app is not built with the 3.1 SDK I don't think this will happen anyway
        //we need to test this
        [self presentModalViewController:self.flowViewController animated:NO];
        //[self toInterfaceOrientation:UIDeviceOrientationPortrait animated:NO];
        [self popViewControllerAnimated:NO];
        [self setNavigationBarHidden:NO animated:NO];
        [self dismissModalViewControllerAnimated:YES];
    }else{ //2nd solution
        DLog(@"3.0!!");
        //[self toInterfaceOrientation:UIDeviceOrientationPortrait animated:NO];
        CATransition *transition = [CATransition animation];
        transition.duration = 0.50;
        transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        transition.type = kCATransitionPush;
        transition.subtype = kCATransitionFade;

        CATransition *tabBarControllerLayer = [CATransition animation];
        tabBarControllerLayer.duration = 0.50;
        tabBarControllerLayer.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        tabBarControllerLayer.type = kCATransitionPush;
        tabBarControllerLayer.subtype = kCATransitionFade;

        [self.tabBarController.view.layer addAnimation:transition forKey:kCATransition];
        [self.view.layer addAnimation:transition forKey:kCATransition];
        [self popViewControllerAnimated:NO];
        [self setNavigationBarHidden:NO animated:NO];

    }
    [self performSelector:@selector(resetFlow) withObject:nil afterDelay:0.75];

}

I’m near convinced there is no solution except for manual rotation which messes up the keyboard rotation.

Any advice would be appreciated!

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:52:37+00:00Added an answer on May 14, 2026 at 6:52 pm

    If you have a navigation controller in a tab bar controller and you only want to allow some views to rotate I have the solution. It may not work for everyone and it may not be the cleanest code, but so far it is the only solution.

    Also, this method assumes that you do not want to see the tab bar when you are off of the first view, although you could possible implement my solution with popOverControllers but I am unsure.

    Create the tabbar controller
    Create the navigation controller
    Create a second navigation controller that will not be on tabbar controller
    put the first navigation controller in the tabbar controller
    configure methods that will pushViewController to first:

    take a screenshot of the current screen.
    put that screenshot into a UIViewController
    push that UIViewController onto the second navigation controller
    present the second navigation controller modally
    after a delay of about .15 seconds push the wanted viewcontroller onto the navigation stack of the second navigation controller.

    Now your current controller is off of the tabBarcontroller and it’s rotation (because this navigation controller is presented modally) is independent of the tabBarController!

    You’ll have to do some work to move back to your first view, but it isn’t that hard.

    This is a detailed solution and I will try to get code up some time. Their is more to this answer but this should be enough to get you started, if you need help just let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am hoping this is a simple stupid noob mistake that can be fixed
First of all, I should say that I'm starting to learn git so that
In developing my current iPhone application, I'm having issues handling the login, logout functionality
Having been stuck with SQL2000 for far too long, I've not really had a
Take this for a simple workflow. An employee creates a document, from here the
I am building a ASP.NET MVC application where I use the following flow :
I'm working my way through a JQuery Solution and for the most part it
I develop a software with Oracle form builder for my final thesis. I want
I am developing a USB based bootloader for HCS08 family of micro-controllers. I have
Per a conversation with @Aaronaught on another thread, I've started converting my application to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.