0

I am working on a news app, and I would like to present portrait and landscape images in the news details page using Xamarin forms.

I would like to have full width image based on screen orientation and the height will be calculated based on image width saving the aspect ratio (without cropping the image). [see attached images]

What is the best practice to do that in Xamarin Forms?

enter image description here

Zuhair Ali
  • 597
  • 1
  • 5
  • 18
  • Unfortunately, there is no easy solution to this because the control doesn't automatically scale. https://stackoverflow.com/a/41395453/4825351 – Dennis Schröer Aug 23 '18 at 06:20

1 Answers1

0

I did it manually - you know your image sizes, also you know your phone width, so getting height is not a problem. After that just set yourimage.HeightRequest = yourheight, nad that's all.