8

I am working on an app that has a UITableViewController that displays a list of values as so:

ScreenShot

How can I shift the table down such that it doesn't clash with my status bar? It seems that I can't apply any constraints to this scene so I'm at a loss.

user3185748
  • 2,478
  • 8
  • 27
  • 43
  • 1
    See this: http://stackoverflow.com/questions/18900428/ios-7-uitableview-shows-under-status-bar?rq=1 – kovpas Dec 28 '14 at 20:45

3 Answers3

2

Use the following 3 properties on your UIViewController

self.edgesForExtendedLayout=UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars=NO;
self.automaticallyAdjustsScrollViewInsets=NO;
Rick
  • 3,240
  • 2
  • 29
  • 53
  • This does not work for a UITableViewController embedded inn a TabBarController. – coco Sep 26 '15 at 09:22
  • This answer is nearly a year old, most likely it worked at the time. I can not be expected to maintain answers so they work with each new version of iOS. Hardly a reason for a down vote IMO. – Rick Sep 28 '15 at 06:28
  • 1
    To be honest, I tried to change the downvote, but it was´t possible any more - so I wrote the comment. Yes I really made a mistake with this first downvote in my live, but it seems like I can´t correct it. – coco Sep 28 '15 at 07:19
1

Set edgesForExtendedLayout for the ViewController to UIRectEdgeNone in your viewDidLoad() method. This will start the tableview from below the status bar

self.edgesForExtendedLayout = UIRectEdgeNone;
itsji10dra
  • 4,603
  • 3
  • 39
  • 59
Utsav Parikh
  • 1,216
  • 7
  • 14
0

Try this on iOS 9. In your view controller viewDidLoad() -

self.yourTableViewReference.contentInset.top = 20
self.yourTableViewReference.scrollIndicatorInsets.top = 20
DS.
  • 2,846
  • 4
  • 30
  • 35