diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs b/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs index 81214957..522ff4b2 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs @@ -421,7 +421,20 @@ namespace Xamarin.Forms.Platform.Android if (global == position || cells.Count > 0) { - cells.Add(group.HeaderContent); + if (_listView.CachingStrategy == ListViewCachingStrategy.RecycleElement) + { + var groupContent = _listView.TemplatedItems.GroupHeaderTemplate.CreateContent(group.ItemsSource, _listView) as Cell; + if (groupContent != null) + { + groupContent.BindingContext = group.ItemsSource; + cells.Add(groupContent); + } + } + else + { + cells.Add(group.HeaderContent); + } + if (cells.Count == take) return cells; } |