Repository navigation
Description
Description
First things first please rename the title of this issue to the more correct one as I didn't know how to title it.
I'm experiencing a problem, might be xaml or shell related. The images dissapear when moving between tabs. If I have Image with its source set on the page on the moment the app is building and debugging it will stay there when changing tabs but when Image is loaded on runtime like when I pull data from API (being binded), (Or add image url in xaml and hot reload) it will dissapear when changing tabs.
When I switched .net run time for all platforms from .net 7 to .net 6 it seems to fix it so the issue might be related to that somehow? That's the only discovery I've made so far. Also this issue doesn't seem to persist on other platforms at least it doesn't on Windows. I don't have any apple devices.
Video shows that when adding an image before hand works fine when switching tabs. But there is a bug when adding an image in runtime. This doesn't happen on .net 6.
2023-03-24_09-20-38.mp4
Steps to Reproduce
- Make fresh project
- Try to add picture on runtime and switch tabs.
Link to public reproduction project repository
https://github.com/ziomek64/TabBarPhotoTest
Version with bug
7.0 (current)
Last version that worked well
6.0.424
Affected platforms
Android
Affected platform versions
Android
Did you find any workaround?
Use maui on .net 6
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
janseris commentedon Apr 10, 2023
Isn't this XAML Hot Reload issue?
ziomek64 commentedon Apr 10, 2023
I don't think so, because this happens when I have image source binded. When I pull data it works fine, but If I go from this page and come back the image is not there. But when a new image with new source is loaded it again works until I leave the page
[-][Android] Image can dissapear when going back to the page.[/-][+][Android] Image can disappear when going back to the page.[/+]kirakosyan commentedon Apr 12, 2023
DevEx claims that the bug in their control is related to this. Information in the discussion can be useful
https://supportcenter.devexpress.com/ticket/details/t1155623/dxcollectionview-does-not-show-images-in-its-items-when-its-parent-tab-is-switched
mtmgoliath commentedon May 4, 2023
I have managed to find a work-around.
I seems that when setting the URL to just a string property in the VM and binding the Image Source to it then the image disappears.
Instead set/bind to a property inside an object in the VM.
Then in the view bind to object's properties
I also found that I was having trouble if binding to a ContentView, instead of directly writing out the layout in the View.
Hopefully this helps get your app out the door!
ziomek64 commentedon May 4, 2023
I honestly would prefer to stay at .net 6 and wait for the fix as I have too much to change. But somebody will use it for sure. I don't need it as I didn't use any new features from 7
ziomek64 commentedon May 4, 2023
I honestly don't know how do they expect people to update to newer version when bugs like that make it impossible to use maui
90 remaining items
Added a UI Test (dotnet#14471)
Added a UI Test (dotnet#14471)
ziomek64 commentedon Jul 29, 2024
This will make it in .net 8?
ziomek64 commentedon Aug 6, 2024
ziomek64 commentedon Aug 9, 2024
devMotcho commentedon Sep 10, 2024
After many hours i found a Solution for this by using Caching the others didnt work on my case:
FFImageLoading.Mauito your project;Adding the namespace to the Page where we want to render the image
xmlns:ff="clr-namespace:FFImageLoading.Maui;assembly=FFImageLoading.Maui"Now we can use ff:CachedImage instead of Image
CacheDuration="1": Cache the image for 1 day.
RetryCount="3" and RetryDelay="600": Retry loading 3 times with a 600ms delay if it fails.
DownsampleToViewSize="True": Resize the image to fit the view, saving memory.
Enjoy. Stay positive!
ziomek64 commentedon Sep 10, 2024
This is fixed though in newest Maui XDDD
devMotcho commentedon Sep 10, 2024
Well i had a problem in my app where in a Page i have 2 ObservableCollections Category and Product and a DishOfTheDay Dish all the images from the Observables had no bug but the DishOfTheDay image when changing tabs and coming back wasnt rendered anymore it would be render only if refresh the page (calling api again)
ziomek64 commentedon Sep 10, 2024
Use newest Maui. No need to install packages