I am working with the ListView in Xamarin.Forms 1.4 and am wondering if there is a way to remove the header (and footer, for that matter...) from my ListView. As it is functioning "out of the box", I have extra white space at the top of my ListView, which if the Header property is set to a text value, would display that value; however, when left to the default, or even set to string.empty, the header still occupies space at the top.
Any guidance would be greatly appreciated!
*Edit 1: *
Just to clarify, I am not using XAML, but straight C#--here is the snippet I am using to create the ListView:
var listView = new ListView
{
//Header = string.Empty,
RowHeight = 160,
ItemsSource = items,
ItemTemplate = new DataTemplate(typeof(ItemCell))
};
I left the commented line in for context/reference...
*Edit 2: * Here is a screenshot from my iOS simulator demonstrating the issue--notice the top image as I scroll the ListView rolling under the header:
UPDATE: Solution
I marked @FredyWenger's answer as correct, but wanted to provide the actual fix that I implemented to take care of this issue. By removing/commenting out the lines below, I was able to get rid of the additional space at the tom and bottom of my ListView:
Content = new StackLayout
{
//VerticalOptions = LayoutOptions.CenterAndExpand,
//HorizontalOptions = LayoutOptions.Center,
Children = { listView }
};