NobsterTheLobster / Xamarin.Forms.GridView

GridView for xamarin forms
MIT License
60 stars 10 forks source link

The View of the GridViewXamlCell cannot be Frame #12

Closed maxchu92 closed 6 years ago

maxchu92 commented 6 years ago

The View of the GridViewXamlCell cannot be Frame. The content of the frame will not be visible. Margin is also not working, unlike ListView.

var vcTemplate = new GridViewXamlCell { View = new Frame { Margin = new Thickness(15, 10), Content = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { lytStockImage, slOrderDetails } } } };

NobsterTheLobster commented 6 years ago

Frame is working for me on UWP. What OS are you testing on. I do see some odd behaviour regarding the margin though in that it seems to be automatically anchoring the frame to the top left of the item container and not respecting the left and top margins. However I'm getting this very same behaviour in the regular list-view as well so it looks to be something with Xamarin.Forms itself. I see an old bug regarding margins not being respected inside view cells, interestingly though the author indicates that using a frame actually solves the problem. https://bugzilla.xamarin.com/show_bug.cgi?id=55135

EDIT: Upgrading to xamarin.forms 2.5.0.122203 appears to resolve the margin issue.