-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grouped table view's footer height #44
Comments
Hey, I don't really remember specifics of grouped table view footers, however you can use UITableView delegate methods to change height. Just extend your view controller(or whatever you use as UITableViewDelegate), and those methods will be called: extension MyController : UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
} Alternatively, you can also use new events system in DTTableViewManager 5: manager.heightForFooter(withItem: String.self) { _ in
return 20
} As you can see, i also used simple String instead of model, so that Hope this helps. |
Oh wow, there's actually a bug on master, where delegate methods for headers and footers are not called. I pushed a fix in ec810e7, can you try and tell me if it works for you? |
Hmm, I cannot make it work... I uploaded a sample project here if you want to take a look: https://github.com/augmentedworks/GroupedTest The DTTableViewManager goes inside this if (line 925):
Therefore it doesn't even reach the last return that you modified in the last commit. I think that if there's a delegate in the view controller, that should be checked first.
as the first check. If there's an override in the view controller, we should just use it. |
@augmentedworks Thanks for providing example project. You need to set a model for section footer for this to work. Modify you example code to following: manager.memoryStorage.addItem("Woman", toSection: 1)
// Add this line
manager.memoryStorage.setSectionFooterModels([""])
manager.heightForFooter(withItem: String.self) { (model, section) -> CGFloat in
return 20
} This way event is getting called, and if you comment event code, delegate will get called as well. |
Oh wow, i misunderstood this for second time. It works for event, but does not work if you want to use UITableViewDelegate methods. |
I pushed a fix, Please let me know if i'm being wrong for the third time =) Big thanks for bringing this up, great to fix such stuff around beta period, not in final release. 🍻 |
It works great now! |
Hello,
how can I set the footer height of a normal grouped table view? Since I can't use the table's delegate methods anymore and I don't want to set a view for a model, I cannot find a way to do it otherwise.
Thank you
The text was updated successfully, but these errors were encountered: