Khi tôi chọn một hàng trong UITableView, tôi đang gọi scrollRectToVisible:animated
trên GCRect của khung của hàng và ngay lập tức sau đó thực hiện một số hoạt ảnh khác. Vấn đề của tôi là tôi không biết khi nào hoạt ảnh từ scrollRectToVisible:animated
hoàn tất.Trong UITableView, làm cách nào để biết khi nào scrollRectToVisible hoàn tất cho một hàng?
Mã của tôi:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView cellForRwoAtIndexPath:indexPath];
[self.tableView scrollRectToVisible:cell.frame animated:YES];
//more animations here, which I'd like to start only after the previous line is finished!
}
+1 Câu hỏi hay, nhưng tôi sợ câu trả lời là: bạn không biết khi nào 'scrollRectToVisible: animated:' finishes. – Sam
Câu trả lời cho câu hỏi sau đây có thể trợ giúp ở đây: http://stackoverflow.com/questions/7198633/how-can-i-tell-when-a-uitableview-animation-has-finished – fishinear