I have a large number of custom views (all the same class) in a scroll view and I’m frequently getting memory warnings. Is it possible to somehow only allow a view to draw when it’s about to be displayed and then release that view when it’s no longer being displayed (i.e. it’s been scrolled past) to reduce memory usage?
Share
If you want to reduce the memory usage of views within a scroll view a better approach consist to define a set of views and reuse them during the scrolling process by putting them in a queue. This requires some work. I don’t know how you want to layout your views but if it is a in a grid you can find some third parties libraries that does just that. One of the most famous one is called GMGridView it worth taking a look to understand how the views are being queued.