Thanks for reply.
After I setup here and there I found out that a class to auto height the table view header to fit a label was the problem.
Next step is to find out what's wrong there but for now it's working.
override func viewDidLayoutSubviews(){
super.viewDidLayoutSubviews()
sizeHeaderToFit()
}
func sizeHeaderToFit(){
guard let headerView = tableView.tableHeaderView else { return }
headerView.setNeedsLayout()
headerView.layoutIfNeeded()
let height = headerView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height
var frame = headerView.frame
frame.size.height = height - 412
headerView.frame = frame
tableView.tableHeaderView = headerView
}
Here the 412 stands for all items (height) in the header together except the textfield.
The header was assigned to class "TableViewHeaderSinglePost" wich contains:
class TableViewHeaderSinglePost: UIView {
@IBOutlet var postTextLabel:UILabel!
override func layoutSubviews() {
super.layoutSubviews()
postTextLabel.preferredMaxLayoutWidth = postTextLabel.bounds.width
}
}
If someone sees the problem please let me know ;-)
Thanks so far for helping me!
Kind regards
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: