Hello,
Welcome to our Microsoft Q&A platform!
For this, you can check the offical document Improve Xamarin.Forms App Performance.
Specially part Optimize image resources, from this document ,we know:
Displaying image resources can greatly increase an application's memory footprint. Therefore, they should only be created when required and should be released as soon as the application no longer requires them. For example, if an application is displaying an image by reading its data from a stream, ensure that stream is created only when it's required, and ensure that the stream is released when it's no longer required. This can be achieved by creating the stream when the page is created, or when the Page.Appearing event fires, and then disposing of the stream when the Page.Disappearing event fires.
When downloading an image for display with the
ImageSource.FromUri
method, cache the downloaded image by ensuring that theUriImageSource.CachingEnabled
property is set totrue
.
In addition, you can try to optimize your code by refering to document: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/performance .
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.