[iOS] Prevent crash when a leaked cell has MenuItem with bindings (#3288)
* Prevent crash when a leaked cell in ListView with Recycle mode has MenuItem with bindings and framework like Xamarin.Forms sets BindingContext to null after leaving the page * Made SetupSelection static
This commit is contained in:
Родитель
a447b5b1af
Коммит
02f006dfe0
|
@ -630,8 +630,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
return null;
|
||||
}
|
||||
|
||||
void SetupSelection(UITableView table)
|
||||
static void SetupSelection(UITableView table)
|
||||
{
|
||||
if (table.GestureRecognizers == null)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < table.GestureRecognizers.Length; i++)
|
||||
{
|
||||
var r = table.GestureRecognizers[i] as SelectGestureRecognizer;
|
||||
|
@ -639,7 +642,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
return;
|
||||
}
|
||||
|
||||
_tableView.AddGestureRecognizer(new SelectGestureRecognizer());
|
||||
table.AddGestureRecognizer(new SelectGestureRecognizer());
|
||||
}
|
||||
|
||||
class SelectGestureRecognizer : UITapGestureRecognizer
|
||||
|
|
Загрузка…
Ссылка в новой задаче