最佳答案
来自document ,它说:
Prior to iOS 9, images were typically placed in the Resources folder with Build Action: BundleResource. However, this method of working with images in an iOS app has been deprecated by Apple.
我刚刚在iOS上做了一个测试,发现如果你将照片放入资源中,它仍然有效。正确的做法是:
如果您使用.jpg
照片,则必须写下全名(我猜您错过了.jpg
):
<Image Source="logo.jpg" />
如果您使用 .png
照片,则可以仅使用照片的名称:
<Image Source="logo" />
我不建议您以这种方式添加照片,因为 Apple 已弃用。现在,Apple 建议您将图像添加到 Assets 目录图像集:
转到Assets.xcassets
-> 新建新图像集
-> 在那里添加您的照片(1x,2x,3x
)。
document中有详细步骤您可以关注。
关于ios - Xamarin 表单,我需要在 IOS 项目中做什么才能让照片显示在 IOS 模拟器中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56049555/