So I have a table view which looks like the photo provided:
My problem is, as you can see, it starts way up at the top, and basically covers the phone battery indicator etc.
How can I make it start further down?
Thanks in advance!
So I have a table view which looks like the photo provided:
My problem is, as you can see, it starts way up at the top, and basically covers the phone battery indicator etc.
How can I make it start further down?
Thanks in advance!
KEEP IN MIND : top 20px is for the status bar (date and battery ) and the top 64 px (including status bar) is for the navigation bar. So if you are using any one these bar then you have to left that px from the top.
You can hide navigation bar but not status bar. So design your UI according to it.
In the end I realized I could "embed in navigator" which automatically pushed it down beneath the top.
How about this:
import UIKit
class MyTableViewController: UITableViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let statusBarHeight = UIApplication.shared.statusBarFrame.height
tableView.frame.origin.y = statusBarHeight
}
}