NAXAM / toptabbedpage-xamarin-forms

TopTabbedPage - A Xamarin.Forms page for showing tabs at top on iOS
Apache License 2.0
81 stars 24 forks source link

Naxam topTabbedpage crash on iOS at run time #23

Open Jeffnac opened 6 years ago

Jeffnac commented 6 years ago

Hi, I get this error when using the plugin on iOS at run time: "Parameter name: str at Foundation.NSString..ctor (System.String str) [0x00027] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/Foundation/NSString.cs:142 at Naxam.Controls.Platform.iOS.TabsView+<>c.b__17_0 (System.String x) [0x00000] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0 at System.Linq.Enumerable+SelectListIterator2[TSource,TResult].MoveNext () [0x00048] in <157801ffd81243c692c66aee241887cd>:0 at System.Collections.Generic.LargeArrayBuilder1[T].AddRange (System.Collections.Generic.IEnumerable1[T] items) [0x0005e] in <157801ffd81243c692c66aee241887cd>:0 at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable1[T] source) [0x00033] in <157801ffd81243c692c66aee241887cd>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00018] in <157801ffd81243c692c66aee241887cd>:0 at Naxam.Controls.Platform.iOS.TabsView.SetItems (System.Collections.Generic.IEnumerable1[T] titles) [0x00030] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0 at Naxam.Controls.Platform.iOS.TopTabbedRenderer.SetControllers () [0x0007d] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0 at Naxam.Controls.Platform.iOS.TopTabbedRenderer.OnPagesChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002b] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0 at Naxam.Controls.Platform.iOS.TopTabbedRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00051] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Platform.iOS.TabbedRenderer.SetupPage (Xamarin.Forms.Page page, System.Int32 index) [0x0000a] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Platform.iOS.TabbedRenderer.Reset () [0x0001c] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Internals.NotifyCollectionChangedEventArgsExtensions.Apply (System.Collections.Specialized.NotifyCollectionChangedEventArgs self, System.Action3[T1,T2,T3] insert, System.Action2[T1,T2] removeAt, System.Action reset) [0x001f9] in D:\a\1\s\Xamarin.Forms.Core\Internals\NotifyCollectionChangedEventArgsExtensions.cs:79 at Xamarin.Forms.Platform.iOS.TabbedRenderer.OnPagesChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Platform.iOS.TabbedRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00063] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage (Xamarin.Forms.Page page) [0x00008] in <85a5f025a15045539371e93897914a5b>:0 at Xamarin.Forms.Platform.iOS.NavigationRenderer+d__51.MoveNext () [0x0001d] in <85a5f025a15045539371e93897914a5b>:0"

I use the version 0.0.3.5 I also add the plugin MaterialControls V1.22 I add "TopTabbedRenderer.Init();" in the AppDelegate

I am not using a XAML file but a full cs file, may it be the origin of the problem ?

Jeffnac commented 6 years ago

Ich rewrite my class using xaml


<?xml version="1.0" encoding="utf-8" ?>
<forms:TopTabbedPage  xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
    android:TabbedPage.BarSelectedItemColor ="#FE5C5C"
    xmlns:views="clr-namespace:App.Views"
    xmlns:forms="clr-namespace:Naxam.Controls.Forms;assembly=Naxam.TopTabbedPage.Forms"
    xmlns:VM="clr-namespace:App.ViewModels"
    x:Class="App.Views.SearchsView"
>
  <!--Pages can be added as references or inline-->
    <views:SearchListView Icon="calendar_icon.png" >
        <x:Arguments>
            <x:String>Agenda</x:String>
        </x:Arguments>
    </views:SearchListView>
    <views:SearchListView Icon="hotel_catering_icon.png" >
        <x:Arguments>
            <x:String>HebergRestau</x:String>
        </x:Arguments>
    </views:SearchListView>
    <views:SearchListView Icon="leisure_icon.png" >
        <x:Arguments>
            <x:String>Activity</x:String>
        </x:Arguments>
    </views:SearchListView>
    <views:SearchListView Icon="eye_icon.png" >
        <x:Arguments>
            <x:String>Tourism</x:String>
        </x:Arguments>
    </views:SearchListView>
    <views:SearchListView Icon="transport_health_icon.png" >
        <x:Arguments>
            <x:String>Pratique</x:String>
        </x:Arguments>
    </views:SearchListView>
</forms:TopTabbedPage>

But I still get the same error.

tuyen-vuduc commented 5 years ago

Are you sure your page having title?

tuyen-vuduc commented 5 years ago

Hi,

Have you managed to use it? We prerelease our package here, it's worth a lot for us to have you try it.

Cheers.