Bug 29050 - Xamarin.Forms.Image Aspect.AspectFill does not work. it yields the exact same results as AspectFit.
Summary: Xamarin.Forms.Image Aspect.AspectFill does not work. it yields the exact same...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-13 13:57 UTC by Andy
Modified: 2015-05-22 19:54 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Andy 2015-04-13 13:57:38 UTC
I want the image to scale up to fill the entire view. Setting the Aspect to Fill does that, but it scales the x and y dimensions differently. AspectFill is supposed to do exactly what I want (fill the entire view while maintaing the aspect ratio), but it does not cover up the entire view. I think there is a bug in that AspectFit and AspectFill are being treated exactly the same.

If I attempt to manually scale up the image to cover the page, I can't be sure that I have set a scale large enough for all devices. Moreover, if the user presses back on a page with a manually scaled image, (for instance scaled to 2.0) then the image bleeds over the edge of the view ( the view itself is now literally twice it's normal width) as the top page scrolls off to the right (forms tends to only do a scrolling page transition this way on iOS).

So, we need to be able to set it to AspectFill and to also be able to manually scale an image without it literally taking up screen space outside of it's own page view.
Comment 1 Andy 2015-04-13 14:47:56 UTC
It turns out I was wrong about this AspectFit on Android. I was not using the default Image class but rather a custom renderer that failed to properly update the Aspect. My apologies.

The remaining issue is the Scale causing the image to draw larger than the size of the view on iOS, especially when you popasync a page that has that, it blurs over the sides and keeps us from being able to set the aspect.
Comment 2 Jason Smith [MSFT] 2015-05-22 19:54:01 UTC
Enable clipping on the parent layout of the image