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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:33:06+00:00 2026-06-08T07:33:06+00:00

I have a UITableView with its backgroundView property set to a UIImageView showing a

  • 0

I have a UITableView with its backgroundView property set to a UIImageView showing a background image. I’m then drawing some cells on top of the image and everything’s working great.

Now I’m trying to display a bar at the top of the screen. To prevent the bar from covering the top rows of the table view, I’m setting its contentInset property to UIEdgeInsetsMake([topBar frame].size.height, 0, 0, 0).

The problem is, changing the contentInset appears to also push the background image view down, so there’s a weird white gap at the top of my table. Weirder still, as soon as I scroll the table view, it fixes itself. Anyone have any idea what’s going on?

If I change the table’s frame as opposed to its contentInset to make room for the top bar, everything works fine, but the background image of the table view is also shifted down, which makes the view appear inconsistent compared to other table views in the app that don’t have a top bar.

This is how I’m setting the table’s background in the table’s init method:

_backgroundImageView = [[UIImageView alloc] initWithFrame:backgroundRect];
[_backgroundImageView setImage:...];
[_backgroundImageView setContentMode:UIViewContentModeBottom];
[self setBackgroundView:_backgroundImageView];

And in the view controller’s viewDidLoad

[_tableView setContentInset:UIEdgeInsetsMake([_topBarView frame].size.height, 0, 0, 0)];

Edit: Well, moving the setContentInset out of viewDidLoad into viewDidAppear: makes it work correctly, except as the view is shown the content inset is wrong, and then it snaps into place once the view appears. Moving the line to viewWillAppear: instead makes it behave as before. Guess something weird is happening between viewWillAppear: and viewDidAppear: that I’m not aware of…

  • 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-08T07:33:08+00:00Added an answer on June 8, 2026 at 7:33 am

    You might just make your table view transparent and put an image view behind it. The proper way to avoid other views (the top bar in your case) is to set the frame property.

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

Sidebar

Related Questions

I have a UITableView with transparent background color, each of its cells have a
I have a UITableView and I want some cells to be the standard UITableViewCells
I have a UITableView and its a checklist. I can add new cells to
I have a UITableView with some cells containing UITextField objects and others with UIButton
I have a UITableView which uses a UIView subclass for its backgroundView and selectedBackgroundView
i have uitableview within uitableview (in its cell, like pulse app), and for some
I have a regular UITableViewController and a UITableView as its only view, and I
I have a UITableView within UINavigationController. By default, its UINavigationBar on iOS is stationary.
I have a UIPopOverController that shows a UIViewController with a UITableview in its view.
I have a uiwebview that sends its loaded page url to a uitableview to

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.