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?
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?
Share Improve this question edited Feb 25 at 23:03 HangarRash 15.1k5 gold badges19 silver badges55 bronze badges asked Feb 25 at 11:13 user29283103user29283103 114 bronze badges 3- Also change order of views. There is no other way to tell navigation bar which scroll view to use for collapsing. – Cy-4AH Commented Feb 25 at 13:13
- The issue occurs because both table views are sharing the same navigation item state. Either track the scroll state for each table view separately or Create a new separate navigation controllers for each table view controller. – khawar ali Commented Feb 26 at 9:47
- Thanks! I fixed it by implementing both tableViews into one tableView. And then I just switch the datasource depending on which button of the segmented control is clicked :) – user29283103 Commented Feb 26 at 11:18
1 Answer
Reset to default 0I 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 :)