UITableViewController按钮在拉动刷新期间停留在顶部 [英] UITableViewController buttons stick to top during pull to refresh
问题描述
我试图弄清楚如何使UITableView
的视图顶部与表格一起滚动,但是当您拉动刷新时,该视图位于屏幕顶部,刷新控件位于屏幕下方.就像Facebook App带有状态",照片"和签到"按钮一样.
I am trying to figure out how to have a UITableView
with a view at the top which scrolls with the table, but when you pull to refresh, the view stays at the top of the screen and the refresh control is below. This is just like the Facebook App with their Status, Photo and Check In buttons.
我不知道该怎么做,有什么主意吗?
I can't work out how to do it, any ideas ?
推荐答案
在Facebook中,标头不是表格视图的一部分,而只是位于表格视图上方的视图.表视图是UIScrollView
的子类,因此您将收到滚动视图委托方法.您可以使用它们来监视滚动视图的内容偏移,然后更改页眉和表视图的框架以获得所需的效果.
In Facebook the header isn't part of the table view, it's just a view positioned above the table view. The table view is a subclass of UIScrollView
so you will receive scroll view delegate methods. You can use these to monitor the scroll view content offset and then change the frames of the header and table views to get the effect you want.
这篇关于UITableViewController按钮在拉动刷新期间停留在顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!