【发布时间】:2019-08-19 02:16:51
【问题描述】:
今天我已将 Xamarin Forms 更新到 4.1 版本,并且不再加载来自 Web 的图像。我尝试重新启动 VS(对于 mac),清理解决方案并重建它,从我的手机中完全删除应用程序,甚至重新启动设备,但似乎没有任何效果。
这是 XAML 标记
<ListView
x:Name="campaignsListView"
HasUnevenRows="True"
RelativeLayout.WidthConstraint="{ConstraintExpression
Type=RelativeToParent,
Property=Width,
Factor=1}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame CornerRadius="10"
RelativeLayout.WidthConstraint="{ConstraintExpression
Type=RelativeToParent,
Property=Width,
Factor=1}">
<StackLayout Orientation="Vertical">
<Image
BackgroundColor="Aqua"
HeightRequest="150"
HorizontalOptions="FillAndExpand"
Source="{Binding CampaignImage}"></Image>
<Label
HorizontalOptions="CenterAndExpand"
Text="{Binding CampaignImage}"></Label>
</StackLayout>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
我不相信任何绑定错误正在发生,因为我最终出于调试目的,将图像 URL 绑定到标签并且它工作正常
编辑: 我注意到我的 VS 更新来自预览频道,我更改为稳定频道,进行了所有更新,现在一切都很好了。作为预览的构建,我相信可能还有一些问题
【问题讨论】:
-
你在哪里以及如何设置
ItemsSource?
标签: xaml xamarin xamarin.forms