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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:09:27+00:00 2026-06-06T15:09:27+00:00

I have a UITableView and a small custom view. I want the custom to

  • 0

I have a UITableView and a small custom view. I want the custom to stay below the navigation bar, but above the tableview. So when the custom view moves up and down, it looks like that the custom view pops out from navigation bar’s back.

At first I make the custom view the subview of the tableview and everything seems fine. But when the tableview is scrolled, the position of the custom view is also changed, which is not what i want.

Then i made the navigation bar the superview, but now the custom view stays above the navigation bar. And i don’t know how to change the z-order between parent view and subview.

So can anybody give me some advice?

Thank you!

  • 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-06T15:09:29+00:00Added an answer on June 6, 2026 at 3:09 pm

    Depending on how you create your view hierarchy – insert it either above the table view or bellow navigation bar:

    - (void)viewDidLoad
        [super viewDidLoad];
        // let's assume self.tableView is table view
        // and self.navigationBar is navigation bar
        // that both are subviews of [self view]
        UIView *customSubview = [[UIView alloc] initWithFrame:someRect];
    
        [[self view] insertSubview:customSubview aboveSubview:[self tableView]];
        // -- OR --
        [[self view] insertSubview:customSubview belowSubview:[self navigationBar]];
    }
    

    There’s also an option to insert your subview at certain index. So if your navigation bar is topmost (i.e. at index 0) and table view is bottommost (i.e. index of [[[[self view] subviews] count] - 1]) you can insert your custom view in-between like this:

    [[self view] insertSubview:customSubview atIndex:1];
    

    This way your table view will descend by one level in its superview and “layering” of subviews will be following:

    1. Index 0 – navigation bar
    2. Index 1 – custom subview
    3. Index 2 – table view

    Beware though that putting your custom subview into standard superview you’d have to maintain the position yourself as it won’t be scrolling together with the tableview as before.

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

Sidebar

Related Questions

i have uitableview and a search bar with searchDisplayController, i fill tableview datasource with
I have a UITableView with regular UITableViewCell, but I don't use any of UITableViewCell's
In my IPhone app I have a UITableView. I want two buttons to appear
I have a UITableView and I want some cells to be the standard UITableViewCells
I have a UITableView with custom cells. Naturally, in cellForRowAtIndexPath I try to dequeue
I have a UIViewController. Its view contains a UITableView as a subview. On viewDidAppear,
I want to add a small button beside my UITableView header that when pressed
I have a UITableView inserted sideways (rotated 90 degrees) in a view. This table
I have a small form (5 fields) in a grouped UITableView. Each UITextField is
I have a view in which I have UITableView (grouped style). In the Interface

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.