if we click on Custom Section Header in UITableView, then move that section to top

后端 未结 2 780
心在旅途
心在旅途 2021-02-04 16:59

I have a Custom Section Header in UITableView, on that section header there placed UIButton on its very right.What i want is, if i click o

2条回答
  •  渐次进展
    2021-02-04 17:42

    You can use the scrollToRowAtIndexPath:atScrollPosition:animated: method from UITableView. Set the button tag to the section and call in his action:

    [tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:button.tag] 
    atScrollPosition:UITableViewScrollPositionTop animated:YES];
    

提交回复
热议问题