I'm using the GridView control from Xamarin-Forms-Labs and even though the control makes use of ItemTemplate, the custom ViewCell can only have one layout. I was trying to use AbsoluteLayout with a StackLayout / Grid in it so that I can layer a background image with a grid over top.
How do I properly render the layout in the iOS renderer so it draws the cell? Can I accomplish this with just the methods from the Xamarin.Forms API or is there more work to be done?
Here is some of the code used to render it currently:
// GridViewRenderer.cs
public UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath)
{
var item = this.Element.ItemsSource.Cast<object> ().ElementAt (indexPath.Row);
var viewCellBinded = (Element.ItemTemplate.CreateContent () as ViewCell);
viewCellBinded.BindingContext = item;
return GetCell (collectionView, viewCellBinded, indexPath);
}
// GridViewCell.cs
private void UpdateView ()
{
if (this.view != null) {
this.view.RemoveFromSuperview ();
}
this.view = RendererFactory.GetRenderer (this.viewCell.View).NativeView;
this.view.AutoresizingMask = UIViewAutoresizing.All;
this.view.ContentMode = UIViewContentMode.ScaleToFill;
this.AddSubview (this.view);
}