Loading Images from Xamarin Forms
Even the UI I built is very simple; I need to load some icons in the UI. I have used navigation page. After I had navigated two pages, then I got an exception, OutOfMemoryException. That is because Bitmap Decode is used a lot of memory. I found we should avoid using:
img.Source = ImageSource.FromFile("test.jpg");
We should use the images in the embedded resources
img.Source = ImageSource.FromResource("advgen.test.jpg");
Please change the properties of the image file:
Then the problem will solve.
Trackback address for this post
Feedback awaiting moderation
This post has 149 feedbacks awaiting moderation...
Form is loading...