Reputation: 592
I'm trying to do something which I would think is pretty simple, but I'm having no luck. I have a button that's using an image and when I resize the button, I'd like the image to resize along with it. I've tried HeightRequest and WidthRequest on the button, but it just resizes the button itself, not the image. I also tried putting the button inside a Stack Layout and setting fill and expand, but still no luck. Thanks in advance for any help
Upvotes: 2
Views: 1472
Reputation: 1802
In order to resize the image, you should use DependencyService to do the resize operation on Android and iOS separately.
Check the following answer that contains an example for such implementation:
Xamarin Forms - Resize Camera Picture
You can also check the sample project dealing with resizing of an image on Xamarin's offical website:
https://developer.xamarin.com/samples/xamarin-forms/XamFormsImageResize/
Upvotes: 2