Hey,
I ran in the Problem that everytime I'm using the SfListView-Header the first HeaderGroup is indented as seen in the screenshot. What I see is that the missing part of the first HeaderGroup is exactly the same size as the scrollbar.
this is my Code
_tripsListView.GroupHeaderTemplate = new DataTemplate(() =>
{
var grid = new Grid()
{
BackgroundColor = Color.FromHex(hexBackgroundColor)
};
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
var grouping = new StackLayout()
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Start,
Orientation = StackOrientation.Horizontal,
Padding = new Thickness(0, 0, 0, 0)
};
var yearLabel = new Label
{
TextColor = Color.FromHex(hexFontColor),
FontSize = fontSize + 6,
FontAttributes = FontAttributes.Bold
};
var groupingImg = new Image() {
Source = ImageSource.FromResource("BaseKit.Resources.arrow_down_white.png"),
};
groupingImg.SetBinding(Image.SourceProperty, "IsExpand", BindingMode.Default, new GroupingConverter(), null);
yearLabel.SetBinding(Label.TextProperty, new Binding("Key"));
grouping.Children.Add(groupingImg);
grouping.Children.Add(yearLabel);
var counting = new StackLayout()
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.EndAndExpand,
Orientation = StackOrientation.Horizontal
};
var countLabel = new Label
{
TextColor = Color.FromHex(hexFontColor),
FontSize = fontSize + 6
};
countLabel.SetBinding(Label.TextProperty, new Binding("Count", BindingMode.Default, null, null, "{0,3:###}"));
var countlabel2 = new Label() { Text = "Trips:", TextColor = Color.FromHex(hexFontColor), FontSize = fontSize + 6 };
counting.Children.Add(countlabel2);
counting.Children.Add(countLabel);
grid.Children.Add(grouping);
grid.Children.Add(counting, 1, 0);
return grid;
});
Attachment:
Screenshot_20181127101709_8f30b482.zip