1

I've created a ListView in Xamarin, I have a custom renderer that renders it as a grouped UITableView. The problem is that the Top Header is taking up space. How do I remove this empty space(margin) in Xamarin C#? I saw a solution in swift and objective-c, but I don't know how to translate it.

This is a solution for Swift:

var frame = CGRect.zero
frame.size.height = 1
tableView.tableHeaderView = UIView(frame: frame)

How can this be done in C#?

JuliusvM
  • 335
  • 6
  • 16
  • Do you mind putting your custom renderer code for the grouped tableview here: https://stackoverflow.com/questions/47851691/xamarin-forms-how-to-make-ios-listview-native-grouped-style-with-headers I have a bounty on it as I can't get it to work for me. – SolidSnake4444 Dec 22 '17 at 19:17

1 Answers1

3

Try this:

var frame = CGRect.Empty;
frame.Height = 1;
MyStuffTableView.TableHeaderView = new UIView(frame);
Pang
  • 9,564
  • 146
  • 81
  • 122
Subhamoy
  • 132
  • 3