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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:16:56+00:00 2026-05-30T02:16:56+00:00

I have a UIView that has 3 sub-views: a header, a center panel, and

  • 0

I have a UIView that has 3 sub-views: a header, a center panel, and a footer. The header and footer are both fixed height, and I’m able to set their autosizing properties so that they behave like I want: the header stays anchored to the top and stretches to fit the screen (portrait or landscape), while the footer stays anchored to the bottom and also stretches with the screen.

The problem I’m having is with the center panel. I’m able to anchor it underneath the header, but I can’t find any way of setting the autosizing properties for this center panel so that it stretches itself so that its bottom is just at the top of the footer. Everything I set seems to stretch it to the bottom of the main UIView (so it’s stretched underneath the footer, which I don’t want).

I can’t do this in code (I think, unless there is a way) by overriding layoutSubviews, because I’m animating this outer view and I need the subviews to resize with the animation. Is there a way to do this in IB?

  • 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-30T02:16:59+00:00Added an answer on May 30, 2026 at 2:16 am

    In code:

    header.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
    content.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    footer.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
    

    In Interface Builder:

    Header:

    enter image description here

    Content:

    enter image description here

    Footer:

    enter image description here

    Explanation:

    The fixed margins (see annotated screenshot below) will keep the view’s distance from the top and bottom of the super view’s bounds constant. This is what you want since you have a fixed height header and footer.

    This stuff is absolutely doable in code. There is nothing you can do in Interface Builder that you can’t do in code as well.

    enter image description here

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

Sidebar

Related Questions

I have created a custom UIView that has some set of UILabels in it.
I have a UIView that has several UIImageViews as subviews. Each of these subviews
I have a UIView container that has two UIImageView s inside it, one partially
I want to have a UIView subclass that has a border image, but I
I have a UIView subclass ( CustomView for purposes of this question) that has
I have a subview that has been added to my UIView. The idea is
I have a UIView that contains a UIScrollView and I want to be able
I have a custom UIView that generates a set of subviews and display them
I have a UIView that has an image and some buttons as its subviews.
I have an XCode project I am working on that has multiple views controlled

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.