Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

ScrollView NullReference

fakhravarifakhravari Member ✭✭✭✭
edited January 2 in Xamarin.Forms

hi
Why do I get this error

The project is okay if we don't use it

Tagged:

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    We need to set its item template to point out what the content looks like. Do you consume this plugin:
    https://github.com/alexrainman/CarouselView?
    If so set up the item template like:

    <controls:CarouselViewControl Orientation="Horizontal" InterPageSpacing="10" Position="{Binding myPosition}" ItemsSource="{Binding myItemsSource}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
        <controls:CarouselViewControl.ItemTemplate>
            <DataTemplate>
                <local:MyView /> <!-- where MyView is a ContentView -->
            </DataTemplate>
        </controls:CarouselViewControl.ItemTemplate>
    </controls:CarouselViewControl>
    
Sign In or Register to comment.