зеркало из https://github.com/DeGsoft/maui-linux.git
Visual element packager (#2775)
* [iOS] Enable ShouldRecognizeSimultaneously on PanGesture fixes #2299 * Add test case for 2296 * Fix test case name/number * Convert fix to opt-in platform specific * Update test case to use platform specific * Fixes insane crash that sometimes happens when adding views. * Added additional null checks for renderers * Adde check for disposed object * [Core] Fix ChildAdd Linq on VEP
This commit is contained in:
Родитель
e0947b2257
Коммит
40bee5c012
|
@ -95,6 +95,8 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
_onForceUpdateSizeRequested = (sender, e) =>
|
||||
{
|
||||
if (nativeCell.Handle == IntPtr.Zero)
|
||||
return;
|
||||
// RenderHeight may not be changed, but that's okay, since we
|
||||
// don't actually use the height argument in the OnMeasure override.
|
||||
nativeCell.Measure(nativeCell.Width, (int)cell.RenderHeight);
|
||||
|
|
|
@ -5,6 +5,7 @@ using Android.Content;
|
|||
using Xamarin.Forms.Internals;
|
||||
using Android.Views;
|
||||
using AView = Android.Views.View;
|
||||
using System.Linq;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
|
@ -109,7 +110,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
IVisualElementRenderer renderer = oldRenderer;
|
||||
if (pool != null)
|
||||
renderer = pool.GetFreeRenderer(view);
|
||||
if (renderer == null)
|
||||
if (renderer == null || (renderer.View?.Handle ?? IntPtr.Zero) == IntPtr.Zero)
|
||||
{
|
||||
Performance.Start(reference, "New renderer");
|
||||
renderer = Platform.CreateRenderer(view, _renderer.View.Context);
|
||||
|
@ -118,7 +119,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
if (renderer == oldRenderer)
|
||||
{
|
||||
Platform.SetRenderer(renderer.Element, null);
|
||||
renderer.Element?.ClearValue(Platform.RendererProperty);
|
||||
renderer.SetElement(view);
|
||||
}
|
||||
|
||||
|
@ -158,7 +159,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
if (view != null)
|
||||
AddChild(view);
|
||||
|
||||
if (ElementController.LogicalChildren[ElementController.LogicalChildren.Count - 1] != view)
|
||||
if (ElementController.LogicalChildren.LastOrDefault() != view)
|
||||
EnsureChildOrder();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче