I currently have a single page xamarin.forms project that switches out the contents of various ContentViews. While in the final stages of test I ran into some OutOfMemory issues in iOS (my main platform currently). One of the things I did to try and debug this issue was to put a WriteLine statement in the destructor for every view and viewmodel because I noticed that allocations continued to go up when switching back and forth between two views. I found that any view that contains a ListView which uses a ViewCell as an ItemTemplate does not get destructed. I have not tried every cell type, but replacing a ViewCell in these cases with a TextCell allows the view to destruct. After attempting various solutions (e.g. creating the viewcell in code, different viewcell contents, etc.) I have resigned myself to posting here in the hopes that someone else has run into this issue in the past and possibly has a solution.
↧