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:
Code
img.Source = ImageSource.FromFile("test.jpg"); |
We should use the images in the embedded resources
Code
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
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 159 feedbacks awaiting moderation...
Form is loading...