Open ivanteles opened 7 years ago
My app on Android experienced the same issue. I changed the caching strategy to RecycleElement and there was no locking/slowdown.
The sample application uses the same caching strategy.
Xamarin.Plugins/Iconize/Samples/Iconize.FormsSample/Page1.xaml
Not sure why the default strategy would cause an issue. In my application, I had a list of ~8 elements max. I used a datatemplate selector where only one item in the list had a IconButton. The slow down always occurred when the list item with the IconButton was off the screen and about to appear (via a scroll).
@eamreyes thanks for the answer!
Where does this CachingStrategy = "RecycleElement" come from? Because in my listview it does not have this property!
@ivanteles that property was added in a Xamarin.Forms release. See Caching Strategy. Or this blog.
My IDE's (R# + VS) intellisense indicates there is an error, but it is valid XAML.
I am having this problem too. Using this nugget package on my android app crashes hard.
For me solved using iconbutton instead of iconlabel
Its doesn't do much of a difference. Overall this plugin is very slow on android.
@eamreyes What version of Xamarin.Forms do you use? I think there are some changes from Xamarin.Forms to set ListView's CachingStrategy and I don't know from which version it is, but I'm using Xamarin.Forms 2.4.0.282 and the XAML code is looks like the following:
<ListView>
<x:Arguments>
<ListViewCachingStrategy>RecycleElement</ListViewCachingStrategy>
</x:Arguments>
</ListView>
but if you want to set the CachingStrategy with code, you can derive from ListView
control and use that derived control into XAML, like this:
public class CustomListView : ListView
{
public CustomListView() : base(ListViewCachingStrategy.RecycleElement)
{
}
}
I'm using the icons in a list, but scrolling the list up and down the app is catching. I discovered this when I commented the icons and the app did not crash any more.