iosuitableviewuisegmentedcontrolpreferslargetitles

Large title doesn't animate properly for TableViewController embedded in SegmentedControl


I have two tableviews that I'm switching back and forth with a SegmentedControl button by adjusting the alpha value of the TableViewControllers (see image 3). I'm perfectly able to switch between them. For the first TableViewController everything works and once I scroll down in the tableview my large title collapses and animates properly (see image 1). Once I switch to the second page this animation does not happen anymore. Basically it ignores the title and just scroll underneath it (see image 2). The segmented control is embedded in a NavigationController with large title. Anyone has an idea on how to fix this?

Large Title collapses

Large Title does not collapse

Storyboard


Solution

  • I fixed it by implementing both tableViews into one tableView. And then I just switch the datasource of the tableview depending on which button of the segmented control is clicked :)