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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:15:29+00:00 2026-05-28T13:15:29+00:00

I have a view controller (derived from UIViewController not UITableViewController) containing a table view.

  • 0

I have a view controller (derived from UIViewController not UITableViewController) containing a table view. The controller and view are both within the same xib.

I want to add a segmented control to appear at the bottom of the screen, with the table view taking up the rest of the space above it.
However in IB it will not let me place the segmented control as a direct child of the view controller, it will only let me place it as a child of the table view i.e. the hierarchy looks like this:

Navigation Controller
Navigation Bar
Main View Controller – Item
Table View
Segmented Control – First, Second
Navigation Item – Item
Bar Button Item – Style

If I run it like this then the segmented control floats up and down depending upon how many items there are in the table view.

What can I do to get it to be locked to the bottom of the screen?

UPDATE:
I got nearer – I added a view as a child of the main view controller and made the table view and segment control children of that, but now only the top half of the control appears when I run the simulator but everything looks fine in IB, why is there a discrepency?

Side question – as a starting point I’m using one of Apple’s sample project, why was there no main view? When should you and when should you not have a main view?

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-28T13:15:29+00:00Added an answer on May 28, 2026 at 1:15 pm

    Just open your xib and expand your view and drag Tableview control under View and also drag segmented control under view not in tablview this will work.

    you need to set frame of both in you viewDidLoad

    tblview.frame = CGRectMake(0, 0, 320, 400);
    sgmntcontrol.frame = CGRectMake(50, 405,150 ,50)];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table view navigation controller and the data is loaded from url. I
I have my view controller class MyVC extending from UIViewController class. In the designated
I have view controller, into the view i have put a table view, and
I have two view controller classes in my application delegate. I can change from
I have a view controller and I am intercepting the touches on links within
I have an abstract base Controller class and all action controllers are derived from
I have a view controller that is called from 2 different places. 1) I
I have a view controller that is used to populate data from the core
I have a view controller who's views are loaded from a nib file. The
I have a view controller which contains a UISearchBar @interface TradeFindHeaderViewController_iPhone : UIViewController {

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.