无法弄清楚如何使图像小于网格中的容器。
即,如果我希望正方形图像是正方形网格单元格大小的 50% 并在单元格内居中,我该怎么做?
无法弄清楚如何使图像小于网格中的容器。
即,如果我希望正方形图像是正方形网格单元格大小的 50% 并在单元格内居中,我该怎么做?
Either
尝试如下设置图像视图的 HorizontalOptions 和 VerticalOptions 属性,
Image imageView = new ImageView;
imageView.HorizontalOptions = LayoutOptions.StartAndExpand (or) LayoutOptions.CenterAndExpand
imageView.VerticalOptions = LayoutOptions.StartAndExpand (or) LayoutOptions.CenterAndExpand
此外,尝试通过设置图像视图的 Aspect 属性,
imageView.Aspect = Aspect.AspectFit