Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Scrollview doesn't stop at the end of the page

$
0
0

I have grid of images, and added a scroll to that page, but the scroll doesn't end when the last image on that grid is seen.How to put a boundary on it to the end of the page.

var grid = new Grid {
            RowSpacing = 0,
            RowDefinitions =
            {
                new RowDefinition { Height = GridLength.Auto },
                new RowDefinition { Height = GridLength.Auto },
                new RowDefinition { Height = GridLength.Auto }
            }
        };

        var beachImage = new Image { Aspect = Aspect.AspectFit };
        beachImage.Source = ImageSource.FromFile("17.jpg");

        var anotherImage = new Image { Aspect = Aspect.AspectFit };
        anotherImage.Source = ImageSource.FromFile("33.jpg");

        var moreImage = new Image { Aspect = Aspect.AspectFit };
        moreImage.Source = ImageSource.FromFile("04.jpg");

        grid.Children.Add (beachImage,0,0);
        grid.Children.Add (anotherImage, 0,1);
        grid.Children.Add (moreImage, 0,2);

        var scroll = new ScrollView {
            VerticalOptions = LayoutOptions.FillAndExpand,
            Content = grid 
        };

        Content = scroll;

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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