最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ios - Large title doesn't animate properly for TableViewController embedded in SegmentedControl - Stack Overflow

programmeradmin1浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

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 :)

发布评论

评论列表(0)

  1. 暂无评论