Setting additional inset for tracking scroll view #493
Unanswered
nikita-bor
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I see some unexpected behavior I wish someone could explain to me. There's Samples project and I change the following things in it to achieve the effect that I need:
In Samples there's a DebugTextViewController. Imagine, I'd like it to have some constant bottom contentInset for the text view. I set textView.contentInset.bottom = 60. It doesn't help because of FloatingPanel's contentInsetAdjustmentBehavior set to .always. Ok, I go ahead and set mainPanelVC.contentInsetAdjustmentBehavior to .never. Now my the text view has 60pt bottom inset. At this point the only thing I need is textView to adjust its insets for possible bottom safe area. Currently it doesn't because of textView.contentInsetAdjustmentBehavior = .never. I comment out this line and now something happens I don't really understand.
Expected: textView has adjustedContentInset == (top: 0, left: 0, right: 0, bottom: 60 + some automatic adjustment)
In fact: textView has adjustedContentInset.top == (top: 178, left: 0, right: 0, bottom: 60 + some automatic adjustment)
TextView gets adjustedContentInset.top from MainViewController which results in a gap. As soon as I expand the panel – insets get better and there's no gap anymore. Why is that happening? How should I avoid that?
Everything I described above can be seen in current main branch Samples project on iPhone 12 Pro, iOS 14. But it's necessary to set useCaseController.set(useCase: .trackingTextView) as an initial use case.
Beta Was this translation helpful? Give feedback.
All reactions