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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:34:25+00:00 2026-06-11T08:34:25+00:00

In my iOS app, I have three web views defined inside another view. Two

  • 0

In my iOS app, I have three web views defined inside another view. Two of the web views may not always be used, so is there a way to ask the remaining views to fill the rest of the screen? The equivalent in android would be when you use “fill_parent.”

Right now I’m doing it all by changing the frames which is really cumbersome.

// There is no top banner, but it does use the footer
topBannerView.frame = CGRectMake(0, 0, 320, 0);
mainView.frame = CGRectMake(0, 0, 320, 400);
footerView.frame = CGRectMake(0, 400, 320, 60);

Is there a way to make the mainView use the rest of the screen without explicitly setting the frame?

  • 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-06-11T08:34:26+00:00Added an answer on June 11, 2026 at 8:34 am

    Instead of hard-coding in the values, you could also put some code in that looks at the sizes of what is being displayed and calculates what size your views need to be from that. It might look something like:

    if(!topBannerView.hidden)
    {
      topBannerHeight = topBannerView.bounds.size.height; //syntax here might be a little off, can't test code right now, but I think it's close to this
    }
    else
    {
      topBannerHeight = 0;
    }
    

    Repeat for other 2 views, then

    topBannerView.frame = CGRectMake(0, 0, 320, topBannerHeight);
    mainView.frame = CGRectMake(0, topBannerHeight, 320, mainViewHeight);
    footerView.frame = CGRectMake(0, (mainViewHeight+topBannerHeight), 320, footerViewHeight);
    

    This way is still kinda clunky, but it will work a little better if you want to resize things in the future.

    EDIT: I cleaned up the syntax, it should be correct now.

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

Sidebar

Related Questions

I have a universal iOS app with a custom view that has three buttons,
I have an iOS app sending requests to a PHP based web service ,
I have an iOS app I created as a view-based app in xCode. I
In order to switch between views in my iOS app, I have been using
I have to make a rest web service call from my ios app, earlier
I have imported a mysql from a web app into my iOS app. This
I have a Rails web app that is used to gather data from an
I'm working on an iOS app and have broken the codebase into two separate
One of the views of my iOS app contains a quite long text inside
In my iOS app I have several UIElement s that can process user input:

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.