In Xamarin Forms, how to size an image within a grid cell?

Viewed 600

can't figure out how to make an image smaller than its container within a grid.

I.e. if I want a square image to be 50% of the size square grid cell and centered within the cell, how can I do that?

2 Answers

Either

  1. you set a WidthRequest, HeightRequest, HorizontalOptions="Center" and VerticalOptions="Center" on your image (but this requires a fixed image size)
  2. or you define another Grid into your parent grid cell. The new (child) grid can define 3 rows "Star" and 3 columns "Star" and your image fills the centered cell. The advantage is that your image can be of any size. It will adapt its size to the screen.
Related