-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] BackgroundImageSource not constrained on iOS #13519
Comments
Hi @mrobraven can you upload simple sample so we can try to understand better?! Thanks |
Hi, Attached below are two screenshots from the XAML previewer. Android, with the image (background gradient) displaying correctly and iOS where the image is far too large. You can see a small change in colour on the iOS variant, which suggests that the displayed image is too large to fit the screen. My aim is to have it constrain to the screen in the same way as on Android. |
Could you please attach a sample project with the image and code used to produce those screenshots? Thanks! |
Hi, Sorry for the delay. Attached is a ZIP containing a sample project directory. Thanks |
The proper fix would be add a ImageAspect for the |
Description
Basically I am trying to use BackgroundImageSource of a ContentPage which works fine on Android devices, fitting to the bounds of the screen. However on iOS, the image is not constrained to the bounds of the screen and only 1/3 of the image is visible because it is too large. I understand that there are workarounds to this which involve using a GridView but implementing this will be impractical and time consuming in my case with a multi-page application (where all of the pages use this image). I believe that as a multiplatform development solution, things like this (things independant from Native UI elements) should be unified across platforms and so I would like to see this implemented whereby the BackgroundImageSource is set to resize to the device screen size on all devices, not just Android ones.
Steps to Reproduce
Expected Behavior
The image, as on Android, should shrink to fit the screen
Actual Behavior
The image displays far too large, 3/4 off of the screen
Basic Information
Version with issue:
Last known good version: never
Platform Target Frameworks:
NuGet Packages: Not relevant
Affected Devices: All iOS
Environment
Show/Hide Visual Studio info
Workaround
A possible workaround is to use the classic Grid Layout to place items over an image which works, but is impractical and will take far too much time to complete on every page of my application. Some pages will also require extra attention as they contain scrollable elements and make use of the keyboard to which I have seen on StackOverflow can cause problems and the fixes to those will take too long.
The text was updated successfully, but these errors were encountered: