0

Project Overview

I have a UITableViewController as the root view controller of a UINavigationController. Its view is a UITableView using the UITableViewStyleGrouped style. The table view also has a UIRefreshControl. I am not using nib/xib files, everything is created programmatically.

Problem

The header for the first section in my table view goes under the navigation bar. The refresh control, however, is in the right place. Normally problems with this are caused by a translucent navigation bar, but mine is opaque already.

Attempted Solutions

self.edgesForExtendedLayout = UIRectEdgeNone

This doesn't produce any changes.

self.tableView.contentInset = UIEdgeInsetsMake(20.0f, 0.0f, 0.0f, 0.0f);

This puts my table view in the right place, but causes the refresh control to be adjusted down as well. Not to mention that this is a dirty solution anyway.

Alec
  • 1,646
  • 3
  • 19
  • 35

2 Answers2

0

Try using:

[self setAutomaticallyAdjustsScrollViewInsets:NO];
Choppin Broccoli
  • 3,048
  • 2
  • 21
  • 28
  • This actually made everything worse. It moved up another 200px or so and the refresh control seems to be gone entirely (probably completely hidden by the navigation bar. – Alec Jan 23 '14 at 21:57
0

You need to use a plain viewcontroller and add the tableview there at the desired position. This is because in case of an uitableviewcontroller the whole tableview is the parentview . I hope you got my point.

Anubrata Santra
  • 666
  • 5
  • 11