gpt4 book ai didi

ios - 刚从 View Controller 面板, Storyboard 中拖动后,uitableview 上方的 xcode 9 额外填充

转载 作者:行者123 更新时间:2023-11-28 08:02:16 26 4
gpt4 key购买 nike

在更新到 Xcode 9.0 之前,我使用 Xcode 8.3.3 在 uitableviewcontroller 上工作。第一行有明确的 large 。升级到Xcode 9.0后出现。即使我取消了 enter image description here automaticallyAdjustsScrollViewInsets ,填充仍然在这里。有没有人遇到过这个问题?如何解决? 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

最佳答案

在 viewdidLoad 中写入以下行 -

  self.automaticallyAdjustsScrollViewInsets = false;

并删除最后一行

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

希望对你有帮助

关于ios - 刚从 View Controller 面板, Storyboard 中拖动后,uitableview 上方的 xcode 9 额外填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46335211/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com