question

Masha0307-7348 avatar image
0 Votes"
Masha0307-7348 asked ColeXia-MSFT commented

The carousel view does not display the current item correctly

 <CarouselView ItemsSource="{Binding Monkeys}"
               PeekAreaInsets="100">
     <CarouselView.ItemTemplate>
         <DataTemplate>
             <StackLayout>
                 <VisualStateManager.VisualStateGroups>
                     <VisualStateGroup x:Name="CommonStates">
                         <VisualState x:Name="CurrentItem">
                             <VisualState.Setters>
                                 <Setter Property="Scale"
                                         Value="1.1" />
                             </VisualState.Setters>
                         </VisualState>
                         <VisualState x:Name="PreviousItem">
                             <VisualState.Setters>
                                 <Setter Property="Opacity"
                                         Value="0.5" />
                             </VisualState.Setters>
                         </VisualState>
                         <VisualState x:Name="NextItem">
                             <VisualState.Setters>
                                 <Setter Property="Opacity"
                                         Value="0.5" />
                             </VisualState.Setters>
                         </VisualState>
                         <VisualState x:Name="DefaultItem">
                             <VisualState.Setters>
                                 <Setter Property="Opacity"
                                         Value="0.25" />
                             </VisualState.Setters>
                         </VisualState>
                     </VisualStateGroup>
                 </VisualStateManager.VisualStateGroups>
    
                 <!-- Item template content -->
                 <Frame HasShadow="true">
                     ...
                 </Frame>
             </StackLayout>
         </DataTemplate>
     </CarouselView.ItemTemplate>
 </CarouselView>

After updating Xamarin 5 My Carousel view does not display the current item correctly. It displays the left extreme element(the first left element which shows the carousel view).I have a method with determines the current element and it reads the information correctly about the current item. but visually displays incorrectly.(LEFT ITEM)PLS.HELP!


dotnet-csharpdotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Masha0307-7348
>I have a method with determines the current element and it reads the information correctly about the current item. but visually displays incorrectly.

Could you post the code behind ? We need complete code to reproduce your problem first .

0 Votes 0 ·

0 Answers