I need to reduce the space between two sections ofUITableView
. I looked at this question but the solution doesn\'t allow for my custom header view because it c
I think you can solve this by adjusting the footer view height to its min: in Storyboard or XIB.
I don't know what you have written in your code for footer height. Sorry if I am wrong.
Possible duplicate of Hide footer view in UITableView
This also may help :
override func viewDidLoad() {
super.viewDidLoad()
tableView.sectionHeaderHeight = UITableViewAutomaticDimension
}
For Swift 3
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
For Swift 4+ you need to implement these two methods
extension MyViewController : UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return CGFloat.leastNormalMagnitude
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
}
TableView Delegate methods doesn't effect with float value is 0.0f. Try giving a value greater than that.
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 0.00001f;
}
- (UIView*)tableView:(UITableView*)tableView
viewForFooterInSection:(NSInteger)section {
return [[UIView alloc] initWithFrame:CGRectZero];
}