XAML图像无法定位在CarouselView的顶部



在我的xamarin.forms应用程序中,我有一个带有图像的carouselview。我想将图像放置在旋转木制顶部的旋转曲线内。我尝试了VerticalOptions="Start",但它不起作用。这是我的轮播Xaml:

<controls:CarouselViewControl
        x:Name="TeaserCarouselView"
        ShowIndicators="true"
        InterPageSpacing="16"
        CurrentPageIndicatorTintColor="#4A9630"
        IndicatorsTintColor="#8bdc6f"
        HeightRequest="300"
        ItemsSource="{Binding MainTeaserImageUrls}">
        <controls:CarouselViewControl.ItemTemplate>
            <DataTemplate>
                <ffimageloading:CachedImage
                    VerticalOptions="Start"
                    Source="{Binding .}">
                </ffimageloading:CachedImage>
            </DataTemplate>
        </controls:CarouselViewControl.ItemTemplate>
</controls:CarouselViewControl>

图像始终位于旋转木马的中心。我该如何更改?

我弄清楚了。我只需要将图像放入网格中。上面的代码除了在<Grid>内的ffimageloading的封装外,没有更改。现在它可以正常工作!

最新更新