UITableView provides the methods indexPathsForVisibleRows and visibleCells, but how can I get the visible sections?
UITableView provides the methods indexPathsForVisibleRows and visibleCells , but how can I get the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have got the solution.
First step, each section will show a UIView that created by
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section, that will be stored into array.When the TableView is scrolled , I want free the invisible section view, so I need know which section is visible or not, follow function code will detect for this purpose, if the view is visible then free it.
(
rectis the frame of the sectionUIView;containerViewis theUITableView)In this way, I can get visible sections of the
UITableView, but I hope the SDK can provide API for this purpose directly.