Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xlabs GridView doesn't work correctly with any Layouts on Android

$
0
0

Hi.
Xlabs GridView on android doesn`t show the Relative or stack layouts. But its work fine on iOS. If i set in "cell.View" img its work fine on both platforms, but if i set any layout in "cell.View" GridView displays only background color on Android on iOS all good, anybody can help?
GridImage.ItemTemplate = new DataTemplate (() => {
var rel = new RelativeLayout ();

            var img = new Image () {
                Aspect = Aspect.AspectFill,
            };
            img.SetBinding (Image.SourceProperty, ".", converter: new FilterToImageSourceConverter ());
            var label = new Label () {
                TextColor = Color.White,
                FontSize = 20,
                XAlign = TextAlignment.Center,
                YAlign = TextAlignment.Center
            };
            label.SetBinding (Label.TextProperty, ".", converter: new FilterToLabelTextConverter ());

            label.GestureRecognizers.Add (new TapGestureRecognizer ((sender, e) => {
                ItemClicked ();
            }));

            rel.Children.Add (img,
                Constraint.RelativeToParent ((parent) => {
                    return 0;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return 0;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return parent.Width;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return parent.Height;
                })
            );

            rel.Children.Add (label,
                Constraint.RelativeToParent ((parent) => {
                    return 0;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return 0;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return parent.Width;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return parent.Height;
                })
            );
            var cell = new ViewCell ();
            cell.View = rel;
            return cell;
        });

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>