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 6248049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:59:08+00:00 2026-05-24T12:59:08+00:00

UIScrollView is set programmatically, please dont post answers with using .xib file. My UIScrollView

  • 0

UIScrollView is set programmatically, please dont post answers with using .xib file.

My UIScrollView is situated in my model class, so i want the code to be able to be easly imported to another project eg. for iPad or with rotating screen.

I have a view:

self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width;, self.view.frame.size.height;)];

And my UIScrollView. I want to set it’s size to cover all screen not counting all bars that my controller class will have. But i dont know how 😉

I though about subtracting self.view.frame.size.height – self.navigationController.navigationBar.frame.height and self.tabBarController.tabBar.height if each exists.

Is there any method that automatically sets UIScrollView size..?

Thank you 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-24T12:59:10+00:00Added an answer on May 24, 2026 at 12:59 pm

    In your UIViewController subclass, you don’t need to worry about the size of any UINavigationController or UITabBarController chrome. Those controllers will automatically resize your controller’s main view to fit the appropriate content area.

    If I’m creating the UIView myself in the controller’s loadView, I usually just initially size it at [[UIScreen mainScreen] applicationFrame]. If I were to add a UIScrollView as a subview that would fill up the entire area of the main view (rather than just using the UIScrollView directly as the main view), I would use self.view.bounds as its frame and be sure to set autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;.

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

Sidebar

Related Questions

I have implemented some code that will automatically set a UIScrollView's ContentOffset when the
I have a UIScrollView and want to set a timer, so if I scroll
I want to set image into UIScrollView, but there is a problem. Image is
I have a UIScrollView with a UIView inside. I want to lock the x-axis
I subclassed UIScrollView Then created an object of it in the main class. Added
I have placed the uiscrollview for viewcontroller. Then I have set my large size
I have a UIViewController subclass which has the view property set to a UIScrollView
I have a horizontally scrolling UIScrollView and I want to display potentially thousands of
I have a horizontal UIScrollview set up (meaning its not one that scrolls up
In a UIScrollView I have a UIImageView with the contentMode set to Aspect Fill.

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.