Reputation: 127
I have a simple page that is supposed to display an image. On my android app it fits to the phone screen, but on my UWP app running on a laptop the image expands out of the window. I have tried all different aspect options and different Horizontal and Vertical Orientation options with no luck.
My page looks like this:
<ContentPage.Content>
<StackLayout >
<StackLayout VerticalOptions="Center" >
<Image Aspect="AspectFit" Source="{Binding ImageSource, Converter={StaticResource LocalByteToImageFieldConverter}}" />
</StackLayout>
</StackLayout>
</ContentPage.Content>
And the output looks like this:
Android:
UWP:
I'm guessing its something small I'm missing but cannot find the right style settings.
Upvotes: 0
Views: 105
Reputation: 66
try this , may be helpful for you
<Grid VerticalOptions="Fill" HorizontalOption="Fill" >
<Image Aspect="AspectFit" Source="{Binding ImageSource,
Converter={StaticResource LocalByteToImageFieldConverter}}" />
</Grid>
Upvotes: 3