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

  • Home
  • SEARCH
  • 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 6173405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:34:01+00:00 2026-05-23T23:34:01+00:00

I have a UIScrollView which contains a view controller which contains a couple of

  • 0

I have a UIScrollView which contains a view controller which contains a couple of contorllers – text fields, buttons, an image, etc…
When it is shown on portrait mode, I want it to act as if there is no scroll view ( its still there, of course, but disabled scrolling and bouncing and etc, content size is application frame’s size ), and the custom view is just displayed normally, but when switching to landscape I want to make the scroll view available to use in order to avoid tight user interface.

I want to use a specific xib file for portrait/landscape modes and not place the objects differently using code, because of localization reasons
I encountered 3 problems doing this:

1)I cant find a way to load and apply to the controller a different xib when rotating ( I’d like it to be a smooth transition as well, but not as important right now )

2)I can’t find a way to set up something beyond the application frame’s in a xib file ( I dont have the buttons and etc directly in a scroll view, but inside a custom view which is inside a scroll view ), So I cant place anything on the invisible part of the scroll view ( the part that needs to be scrolled into in order to be seen )

3)I cant find a way to specify a scroll view’s content size via a xib file, which is needed in order for the interface to be as flexible as possible for localization.

Do you have any ideas on how to implement/solve these needs?

Thanks in advance!

  • 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-23T23:34:02+00:00Added an answer on May 23, 2026 at 11:34 pm

    I would advise doing the first thing you said you wouldn’t do:

    I want to use a specific xib file for portrait/landscape modes and not
    place the objects differently using code

    I have spend a good amount of time trying to use a different XIB for different orientation but here is the deal:

    1) If you have an UITextField in Portrait, when you rotate to landscape, you have to be sure that the text in portrait mode is the same in landscape, for example. You have to do that for every object.

    2) Even if you dont look to point 1) I was never able to implement the two xibs solution successfully. I am not saying you cant do it, I am just saying from my experience, that I could not achieve that.

    So, if you at least think doing the 1 xib solution, I could explain a bit:

    -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)orientation{
    
    }
    
    -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
        NSLog(@"My view will rotate");
        if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
            [self viewsPositionPortrait];
        } else if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){
            [self viewsPositionLandScape];
        }
    }
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        NSLog(@"Register should rotate");
        return YES;
    }
    
    -(void)viewsPositionPortrait{
    

    //Create the frame for your “oneOfmyViews” for the portrait rotation
    oneOfMyviews.frame=CGRectMake(…,….,…,…);
    }

    -(void)buttonsPositionLandScape{
    

    //Create the frame for your “oneOfmyViews” for the landscape rotation
    oneOfMyviews.frame=CGRectMake(…,….,…,…);

    }
    

    You could then in the viewsPosition methods define your view’s frames. What you win?

    1) Clean code.

    2) Beautiful transitions.

    3) Specify your scroll view’s content size easily.

    For you problem with the rotation of your UIViews => CustomViewController => UIScrollView.
    You can do something like this:

    1) Do exactly the same thing in your custom view (methods above) for your UIViews inside your CustomViewController.

    2) In the view that has your CustomViewControllers you can do the following:

    -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
        //(everything that i posted above)
        [myCustomViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
    }
    

    This way you will make the UIViews inside your customViewController rotate. One last tip: disable autoresize-subviews and take out every auto-sizes from your UIViews (because you will be defining their frame individually).

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

Sidebar

Related Questions

I have a UIScrollView which contains a view (lets call this main view) which
I have a UIScrollView on screen. Scroll view contains a view in which are
I have view which contains a scrollView. When the view shows up the image
I have a UIScrollView which contains many UIImageView s, UILabels, etc... the labels are
New to iPhone dev. I have a view which contains a UIScrollView which contains
I have a UIScrollView which contains some small UIView subclass. UIScrollView is scroll enabled,
I have a scroll view which has one UIView inside which contains the content.
I have a UIScrollView which contains any number of thumbnails that should detect the
I have a UIView which contains many items like UIScrollView. How can I specify
I have a UIScrollView which contains a timelime. Sometimes I may only want 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.