ReverseExtension icon indicating copy to clipboard operation
ReverseExtension copied to clipboard

Custom section header view not working.

Open DavidTomic opened this issue 6 years ago • 3 comments

Hi,

If I use method for custom section header view than header is not presented properly:

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?

Can you provide me instructions what should I do to make this work, thank you.

DavidTomic avatar Jun 04 '18 10:06 DavidTomic

Any solution on this issue?

ridvank avatar Jun 25 '18 18:06 ridvank

Hi! You can use 'viewForFooterInSection' method in UITableViewDelegate and added UILabel().

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { let label = UILabel() label.text = messages.sectionInfoAtIndex(section).name label.textColor = UIColor.white.withAlphaComponent(0.4) label.center = tableView.center label.font = UIFont.boldSystemFont(ofSize: 10) label.textAlignment = .center return label }

It's work for me

dufflink avatar Oct 22 '18 08:10 dufflink

@dufflink It works except for the section index NOT reversed, right? fyi: https://github.com/marty-suzuki/ReverseExtension/pull/58 😉

toshi0383 avatar Aug 27 '21 06:08 toshi0383