Closed pepejeria closed 5 years ago
I solved this by overriding AcknowViewController
:
class LicenseDetailsViewController: AcknowViewController {
override init(acknowledgement: Acknow) {
super.init(acknowledgement: acknowledgement)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
if #available(iOS 11.0, *) {
textView?.contentInsetAdjustmentBehavior = .never
}
textView?.autoPinEdgesToSuperviewEdges()
}
}
Here auto-layout is used to pin the textView's edges to the superviews and add set the textViews' contentInsetAdjustmentBehavior
property to never.
Another solution that I tried was to set the AcknowViewController
's edgesForExtendedLayout
to []
, but that causes problems with the translucent navigation bar.
Hello José, and thanks a lot for the feedback.
I’m trying to reproduce the issue you’re describing, but the initial scroll view offset seems fine to me (tested with iOS 9, iOS 11, iOS 12).
Are you sure you’re using the latest version of AcknowList? Can you try with the example project included in this repo?
I was unable to trigger this by modifying your example project. I have something like this in my app:
class ViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: true)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(false, animated: true)
}
@IBAction func pushAcknowList(_ sender: AnyObject) {
let viewController = AcknowListViewController(fileNamed: "Pods-acknowledgements")
navigationController?.pushViewController(viewController, animated: true)
}
}
But couldn't trigger the issue. The UINavigationController is created programmatically. I guess this can be close then.
The first two lines of text will appear below the navigation bar when pushing in the
AcknowViewController
controller. This could be solved by using isTranslucent false on the navigation bar, but a better solution would be to use auto-layout in theAcknowViewController
.