Reputation: 121
I've got an UITableView which contained sections, each with a header view. When you click on a header, the section is expending (so the numbers of rows in the section goes from 0 to X at this moment and rows are inserted with animation)
The problem is that when you don't have any section expended, the TableView won't scroll when you try to go to the bottom for the exemple (when you only have the section headers displayed and 0 row anywhere)
I suspect it's because there is no row at all (because as soon as one section is expended, the TableView is scrolling normally) but I can't find any solutions.
Any idea ?
Upvotes: 2
Views: 1113
Reputation: 365
If you're using a custom view, an xib file, for your tableView, make sure that the "view" in your xib file is a 'uiview class', not 'uitableviewcell'.
Doesn't matter what custom you use for the view, but the view itself must be a 'uiview'. Delete whatever view you have in your xib, and drag a uiview from object library in xcode and setup from there, your custom class can still be usable by the 'uiview'
Upvotes: 1
Reputation: 379
may be this will help you
in your viewDidload method
TableView.alwaysBounceVertical =YES; // it is your choice that you want it vertical or horizontal .
TableView.directionalLockEnabled = YES;
i used it in my project when my data is smaller for my view but it still my page scrolled.
Upvotes: 0
Reputation: 86
I would put this in a simple comment but I do not have the reputation to do so. Do the sum of the header views all equate to a height larger than the view that they are in? Additionally, check to make sure you do not have the UITableView does not have the scrolling disabled. If you are unsure, override it with the following code in your ViewDidLoad()
method in your UITableView
file:
tableView.scrollEnabled = true
Hope this can help, comment if this does not work and I will try to help you fix it.
Upvotes: 1