xaml - xaml 图像无法定位到 carouselview 的顶部
问题描述
在我的 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>
图像始终位于 Carousel 的中心。我怎样才能改变这个?
解决方案
我想到了。我只需要将图像放入网格中。ffimageloading
上面的代码除了封装内部 a外没有变化<Grid>
。现在它工作正常!
推荐阅读
- react-admin - 如何为 TextField 应用 Material-ui 样式
- tensorflow - 如何构建一个神经网络来推断最重要特征的一组值?
- docker - Dockercompose 无法使用主机名访问
- ios - 如何避免将核心数据实体作为错误获取?
- javascript - 从数据库中获取数据后,setState 在本机反应中不起作用
- r - 合并两个数据框,但意味着两者中都存在的列
- python - 避免对特定列 pandas 进行四舍五入
- angular - 角度为 5 的 GBP 货币的 Kendo 数字文本框
- postgresql - PostgreSQL:后端进程长时间处于活动状态
- php - 在 PHP 7.3 扩展中通过引用传递多个变量