I am working on an app that has a UITableViewController that displays a list of values as so:
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.
I am working on an app that has a UITableViewController that displays a list of values as so:
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.
Use the following 3 properties on your UIViewController
self.edgesForExtendedLayout=UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars=NO;
self.automaticallyAdjustsScrollViewInsets=NO;
Set edgesForExtendedLayout
for the ViewController to UIRectEdgeNone
in your viewDidLoad()
method. This will start the tableview from below the status bar
self.edgesForExtendedLayout = UIRectEdgeNone;
Try this on iOS 9. In your view controller viewDidLoad() -
self.yourTableViewReference.contentInset.top = 20
self.yourTableViewReference.scrollIndicatorInsets.top = 20