10

I have view controller with 2 tables inside. Tables are placed horizontally near each other. I have kind of segmented control to switch between these tables. I want to use large titles. An I want large titles to collapse and expand. As far as I know UINavigationBar (or maybe it is another object?) observes offset of the scroll view which is at index 0 in the subviews array. So, when I switch to another table I call this

view.sendSubview(toBack: table)

I also tried to force NavigationBar assign new scroll view by calling this

self.navigationController?.navigationBar.prefersLargeTitles = false self.navigationController?.navigationBar.prefersLargeTitles = true

It helps to assign new scroll view. But sometimes scroll view is buggy on the first dragging event.

I also tried to add kind of RootScrollView to ViewController and send offset changes to it. This way I could avoid changing assigned ScrollView. But it is also buggy. You can find some info here: https://github.com/uias/Pageboy/issues/122 One developer was able to accomplish such behaviour, but later it became buggy

Any suggestions are really welcome!

UPDATE: If you have any suggestions about ScrollView struggle in the video, please share them. Thanks!

enter image description here

Taras Nikulin
  • 177
  • 11
  • related: https://stackoverflow.com/questions/54540262/navigation-bar-with-prefers-large-titles-and-embedded-pageviewcontroller-not-c – pkamb Oct 08 '21 at 00:31

0 Answers0