0
如何在完成加载时一直滚动到UITableView的底部?滚动到UITableView的底部(UITableView在UITableViewCell中)
UITableView位于UITableViewCell中,UITableViewCell位于UItableView自身中。
所以: 的UITableView - >的UITableViewCell - >的UITableView(滚动这里的底部)
这是崩溃:
func reloadData(){
if (neighbourhoodJoined){
messageInputView.hidden = false
chatroomMessagesListReversed = chatroomMessagesList.reverse() as! [ChatroomMessage]
chatroomTableView.reloadData()
dispatch_async(dispatch_get_main_queue(), {() -> Void in
var iPath = NSIndexPath(forRow: self.chatroomTableView.numberOfRowsInSection(0)-1,
inSection: self.chatroomTableView.numberOfSections-1)
self.chatroomTableView.scrollToRowAtIndexPath(iPath,
atScrollPosition: UITableViewScrollPosition.Bottom,
animated: true)
})
}
}
' tableView.setContentOffset(CGPointMake(0,tableView.contentSize.height - tableView.frame.size.height),animated:true)' – washloops
如果我补充说,它不会一直滚动到底部和我的PullToRefresh函数在加载时被调用。 –