0

So I have a table view which looks like the photo provided:

Example of tableview on phone

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!

Steffen L.
  • 149
  • 2
  • 14

4 Answers4

1

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.

dahiya_boy
  • 9,298
  • 1
  • 30
  • 51
0

Hy, You have to Drag the UITableView under the top_bar, enter image description hereas below

Amit Rawat
  • 303
  • 2
  • 6
  • This didn't work. Using "table view cell" to design my own cells, it won't let me drag the table view at all. – Steffen L. Feb 08 '17 at 09:17
0

In the end I realized I could "embed in navigator" which automatically pushed it down beneath the top.

Steffen L.
  • 149
  • 2
  • 14
0

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
  }

}
Wilson
  • 9,006
  • 3
  • 42
  • 46