-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images loaded into CollectionView items via ImageSource.FromResource at runtime are not visible and break the layout #13904
Comments
If you make the image buildAction as MauiImage rather than embedded resource and try loading the image as below - i see the app works without issues.
|
Thank you, @liveinvarun! |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Hi ! I'm having the same problem but im not using local images. I'm receiving a list of ByteArrays (each one is a different image) and im using the ByteArrayToImageSourceConverter from the toolkit to convert the images to an ImageSource. I still have not found a workaround for this as I assume the workaround proposed by @liveinvarun won't work in this scenario. Is anyone doing something similar and found a possible solution/workaround ? I'm losing my mind over this |
I was facing the same problem today, and I found that under certain cases, for example when returning to a View, this problem appears. I suspect there could be an issue in The I have solved it by modifying the Converter so it uses another overload which accepts a Task. This seems to be handled better in the underlying platform handlers of Maui: |
I have the same problem, I have collection view with images from url, and when i am switching tabs and came back, collection view loses all images, to show lost images i have to scroll collectionview items |
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Can repro on android platform with sample project. |
I've got the same issue if i use ImageSource.FromStream it trows that error "Only the original thread that created the view ..." |
Description
Hello,
If you show images in CollectionView items and update these items at runtime, certain images may not be loaded with the corresponding exception in the output. After that, the entire application's layout becomes broken. The issue occurs only on Android devices.
Steps to Reproduce
The screencast below illustrates these steps and the problematic behavior:
Screencast.mp4
Link to public reproduction project repository
https://github.com/AndreyMarten/maui-android-image-from-resource-issue
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: