From 724185eac8621a25e6a4514c7e02ad02199e5ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Wed, 9 Oct 2019 09:52:27 +0200 Subject: [PATCH] [iOS] Fixed crash displaying strings in CarouselView (#7858) * Added repro sample * Fixed the crash on DequeueReusableCell registering the correct cell types * Added instructions to the test * Fixed wrong paths on Controls Issues projitems --- .../Issue7789.xaml | 39 +++++++++++++++++++ .../Issue7789.xaml.cs | 38 ++++++++++++++++++ ...rin.Forms.Controls.Issues.Shared.projitems | 14 ++++++- .../CollectionView/CarouselViewController.cs | 1 + 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml.cs diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml new file mode 100644 index 000000000..8c8619e30 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml @@ -0,0 +1,39 @@ + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml.cs new file mode 100644 index 000000000..d9046aa12 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7789.xaml.cs @@ -0,0 +1,38 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using Xamarin.Forms.Xaml; +using System.Collections.Generic; + +#if UITEST +using Xamarin.UITest; +using Xamarin.UITest.Queries; +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [NUnit.Framework.Category(UITestCategories.CollectionView)] +#endif +#if APP + [XamlCompilation(XamlCompilationOptions.Compile)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 7789, "CarouselView crash when displaying strings", PlatformAffected.iOS)] + public partial class Issue7789 : TestContentPage + { + public Issue7789() + { +#if APP + Device.SetFlags(new List { CollectionView.CollectionViewExperimental }); + InitializeComponent(); +#endif + } + + protected override void Init() + { + + } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 078b0fe98..d09034688 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -61,6 +61,9 @@ Code + + Code + @@ -1407,7 +1410,10 @@ Issue7357.xaml - + + Issue7789.xaml + + Issue7519Xaml.xaml @@ -1492,4 +1498,10 @@ MSBuild:Compile + + + Designer + MSBuild:Compile + + \ No newline at end of file diff --git a/Xamarin.Forms.Platform.iOS/CollectionView/CarouselViewController.cs b/Xamarin.Forms.Platform.iOS/CollectionView/CarouselViewController.cs index 36be38e2f..ced46e8b6 100644 --- a/Xamarin.Forms.Platform.iOS/CollectionView/CarouselViewController.cs +++ b/Xamarin.Forms.Platform.iOS/CollectionView/CarouselViewController.cs @@ -60,6 +60,7 @@ namespace Xamarin.Forms.Platform.iOS protected override void RegisterViewTypes() { CollectionView.RegisterClassForCell(typeof(CarouselTemplatedCell), CarouselTemplatedCell.ReuseId); + base.RegisterViewTypes(); } internal void TearDown()