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.

when sliding CarouselView, the previous images disappears

sanerburcusanerburcu Member ✭✭

hi all ,

i am using CarouselView with image template, but I am sliding images forwardly everything is ok but when I am sliding backward the previous images are shown in white

this is my xaml code

what am I doing wrong ?

   <CarouselView x:Name="TheCarousel"
                          ItemsSource="{Binding ImageSources}"
                           >
                <CarouselView.ItemTemplate>
                    <DataTemplate>
                        <Image Source="{Binding .}">
                        </Image>
                    </DataTemplate>
                </CarouselView.ItemTemplate>
            </CarouselView>

Best Answer

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    Try to wrap the image with a layout and set height and width on it .

     <CarouselView.ItemTemplate>
            <DataTemplate>
                <StackLayout>
                    <Image Source="{Binding .}" HeightRequest="100" WidthRequest="100"/>
                </StackLayout>
            </DataTemplate>
        </CarouselView.ItemTemplate>
    
  • sanerburcusanerburcu Member ✭✭

    unfortunately that does not change anything

        <CarouselView x:Name="TheCarousel"
                              ItemsSource="{Binding ImageSources}">
            <CarouselView.ItemTemplate>
                <DataTemplate>
                    <StackLayout >
                        <Image Source="{Binding .}" HeightRequest="200" WidthRequest="200"/>
                    </StackLayout>
                </DataTemplate>
            </CarouselView.ItemTemplate>
        </CarouselView>
    
  • ColeXColeX Member, Xamarin Team Xamurai

    Could you provide a basic project to help us reproduce the problem ?

    Zip your project and attach here .

  • sanerburcusanerburcu Member ✭✭

    thanks for your support

    i uploaded the project, please see the attachment

    I am testing with iPhone 5s simulator and on a real iPhone 11 device. the

  • sanerburcusanerburcu Member ✭✭

    thank you very much for helps! it works now!

    is it a xamarin bug? why is not working from PCL project?

  • ColeXColeX Member, Xamarin Team Xamurai

    @sanerburcu said:
    thank you very much for helps! it works now!

    is it a xamarin bug? why is not working from PCL project?

    I'm not sure , but we recommend you use image in specific project .

Sign In or Register to comment.