Skip to content

Commit 51fd727

Browse files
committed
Fix incorrect offset in Announcements that rendered posts behind the nav title bar instead of below it
1 parent 9917578 commit 51fd727

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

App/View Controllers/AnnouncementViewController.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,21 @@ final class AnnouncementViewController: ViewController {
9191
}
9292

9393
private func updateScrollViewContentInsets() {
94+
renderView.scrollView.contentInset.top = view.safeAreaInsets.top
9495
renderView.scrollView.contentInset.bottom = view.safeAreaInsets.bottom
96+
renderView.scrollView.scrollIndicatorInsets = renderView.scrollView.contentInset
9597
}
9698

9799
// MARK: Lifecycle
98100

99101
override func viewDidLoad() {
100102
super.viewDidLoad()
101103

104+
extendedLayoutIncludesOpaqueBars = true
105+
102106
renderView.frame = CGRect(origin: .zero, size: view.bounds.size)
103107
renderView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
108+
renderView.scrollView.contentInsetAdjustmentBehavior = .never
104109
view.insertSubview(renderView, at: 0)
105110

106111
renderView.registerMessage(RenderView.BuiltInMessage.DidTapAuthorHeader.self)
@@ -167,8 +172,8 @@ final class AnnouncementViewController: ViewController {
167172
messageViewController?.themeDidChange()
168173
}
169174

170-
override func viewWillLayoutSubviews() {
171-
super.viewWillLayoutSubviews()
175+
override func viewDidLayoutSubviews() {
176+
super.viewDidLayoutSubviews()
172177
updateScrollViewContentInsets()
173178
}
174179

0 commit comments

Comments
 (0)