c# - 图像在运行时不显示在 ListBox 中
问题描述
图像显示在 XAML 中,但是当我运行程序时,图像不会显示在列表框中。它只显示框但没有图像。
这是代码:
<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden" Margin="103,156,67.6,65">
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBoxItem>
<Image Margin="0,0,20,0" Width="225" Source="pictures/gw1.jpg"></Image>
</ListBoxItem>
<ListBoxItem>
<Image Margin="0,0,20,0" Width="225" Source="pictures/ja2.jpg"></Image>
</ListBoxItem>
<ListBoxItem>
<Image Margin="0,0,20,0" Width="225" Source="pictures/tj3.jpg"></Image>
</ListBoxItem>
</ListBox>
</ScrollViewer>
解决方案
推荐阅读
- javascript - 无法通过 sequelize.authenticate() 方法使用异步等待
- oracle - ORA-02315: 默认构造函数的参数数量不正确
- javascript - 如何在JS中的时间轴图表中对标签进行分组
- python - 无法将 bigquery.QueryJobConfig() 中的 default_dataset 设置为字符串
- swift - 从 iCloud 下载的 Swift AVAsset 在 iOS 14 上没有权限:错误代码=257
- python - 在Django中获取上个月的第一个和最后一个日期
- c# - “本地编译失败。.Net 无法加载运行时程序集”
.dll'." 的长度为 85,在 "Loc" 附近不同(索引 0) - xaml - Xamarin,带有按钮的居中标题的xaml titleview
- pandas - 根据指定范围乘以行数
- python - 使用 Opencv 或 Python 中的任何其他库的 HDMI-USB 视频采集卡流