I am new to iPhone programming and I am stuck on a problem. I have implemented the section headers and rows in a UITableView where I am expanding and collapsing the rows on clicking the section header. But the problem is this: when the rows are expanding on clicking the section header, and the scrolling rows are going underneath the section headers. I want to scroll both the rows and section headers, and it should not go under the section header. How can I achieve the desired effect?
Asked
Active
Viewed 271 times
0
msgambel
- 7,270
- 4
- 44
- 61
Tejas Shah
- 3
- 3
-
Can you put the screen shot of what's happening? – Rushi Jan 19 '13 at 12:47
-
check related stackoverflow Question:-http://stackoverflow.com/questions/1938921/expand-collapse-section-in-uitableview – Nitin Gohel Jan 19 '13 at 12:52
1 Answers
0
I think you forgot calling the following methods after you updated your data source:
To add rows:
[self.tableView insertRowsAtIndexPaths:<#(NSArray *)#> withRowAnimation:<#(UITableViewRowAnimation)#>];
To remove rows:
[self.tableView deleteRowsAtIndexPaths:<#(NSArray *)#> withRowAnimation:<#(UITableViewRowAnimation)#>];
Also you may need
[self.tableView insertSections:<#(NSIndexSet *)#> withRowAnimation:<#(UITableViewRowAnimation)#>];
and
[self.tableView deleteSections:<#(NSIndexSet *)#> withRowAnimation:<#(UITableViewRowAnimation)#>];
VisioN
- 138,460
- 30
- 271
- 271
Thomas Kekeisen
- 4,449
- 4
- 34
- 54