1

Before updating to Xcode 9.0 , I use Xcode 8.3.3 to work on uitableviewcontroller. There has first row explicit large . After upgrading to Xcode 9.0, it occurs. Even though I cancel enter image description hereautomaticallyAdjustsScrollViewInsets , the padding is still here. Hass anyone ever encountered to this issue ? How to resolve it ? enter image description here

enter image description here

override func viewDidLoad() {
    super.viewDidLoad()

    // Uncomment the following line to preserve selection between presentations
    // self.clearsSelectionOnViewWillAppear = false

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem()
    let btn1 = UIButton(type: .custom)
    btn1.setImage(UIImage(named: "add"), for: .normal)
    btn1.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
    btn1.addTarget(self, action: #selector(createStaff(sender:)), for: .touchUpInside)
    let item1 = UIBarButtonItem(customView: btn1)

    let btn2 = UIButton(type: .custom)
    btn2.setImage(UIImage(named: "back_arrow"), for: .normal)
    btn2.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
    btn2.addTarget(self, action: #selector(back(sender:)), for: .touchUpInside)

    let item2 = UIBarButtonItem(customView: btn2)

    self.navigationItem.setRightBarButton(item1, animated: true)
    self.navigationItem.setLeftBarButton(item2, animated: true)
    self.automaticallyAdjustsScrollViewInsets = false;


    self.edgesForExtendedLayout = UIRectEdge.init(rawValue: 0)

 }

I HAVE EVEN TICKED SAFE LAYOUT BUT TO NO AVAIL

Jeff Bootsholz
  • 2,971
  • 15
  • 70
  • 141

1 Answers1

0

write the following line in viewdidLoad -

  self.automaticallyAdjustsScrollViewInsets = false;

and remove the last line

self.edgesForExtendedLayout = UIRectEdge.init(rawValue: 0)

Hope it helps...