【问题标题】:xaml image can not positioned to top of carouselviewxaml 图像无法定位到 carouselview 的顶部
【发布时间】:2019-07-10 09:44:00
【问题描述】:

在我的 Xamarin.Forms 应用程序中,我有一个 CarouselView,里面有图像。 我想将图像定位在 Carousel 顶部的 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>

图像始终位于轮播的中心。我该如何改变?

【问题讨论】:

    标签: xaml user-interface mvvm layout xamarin.forms


    【解决方案1】:

    我想通了。我只需要将图像放入网格中。除了将ffimageloading 封装在&lt;Grid&gt; 中之外,上面的代码不会改变。现在它工作正常!

    【讨论】:

      猜你喜欢
      • 2020-03-12
      • 2019-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-21
      • 1970-01-01
      • 1970-01-01
      • 2021-07-10
      相关资源
      最近更新 更多