Xamarin Forms: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation

后端 未结 2 1067
予麋鹿
予麋鹿 2021-02-15 18:09

I am struggling with this issue. I created just a simple cross platform page here is XAML code:




        
2条回答
  •  不要未来只要你来
    2021-02-15 18:46

    You have mistake in your Carousel page

    
    
      
    

    Carousel page should have only one child, and it should be a ContentPage, you won't be able to add both label and content page. Remove this line

     

    If you want to have both label and content in a Carousel, I would suggest using something like CarouselView.

    EDIT 1

    I've create a sample Carousel project with latest Xamarin.Forms (2.2.0.31), I've tested it on iOS and Android and it works. You can use it as a starter to implement your version. I use this control in production app.

提交回复
热议问题