Expand UITableView Header View to Bounce Area When Pulling Down

前端 未结 4 537
孤独总比滥情好
孤独总比滥情好 2021-02-03 11:10

I have implemented a MKMapView in the header area and I\'d like to expand it fully to the top even when you drag down the table into the bounce area - Similar to Fours

4条回答
  •  遥遥无期
    2021-02-03 11:42

    Implement the scrollview delegate for table view. Since it is a subclass of scrollview you can use the scrollview delegates. Implement scrollViewDidScroll delegate and whenever it scrolls down, change the frame of headerview and make sure the pin always comes in the center of the screen.

    Include UIScrollViewDelegate in .h file and implement,

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
      //set the frame of MKMapView based on scrollView.contentOffset and make sure the pin is at center of the map view
    }
    

提交回复
热议问题