【问题标题】:Xamarin.IOS: Can't load image from Images.xcassetsXamarin.IOS:无法从 Images.xcassets 加载图像
【发布时间】:2016-05-25 02:47:07
【问题描述】:

我正在开发 Xamarin Studio,我有一个 Storyboard,其中包含一个 UIImageView,其属性设置如下:

您会注意到所选图像名为 personalPhoto,它存在于 Images.xcassets 中,如下所示

但是当我在模拟器中运行应用程序时,图像没有加载.. UIImageView 看起来是空的

即使尝试使用此代码以编程方式添加 UIImageView .. 它给了我相同的结果

UIImageView personImage = new UIImageView {
    Frame = new CoreGraphics.CGRect (0, 0, 200, 200),
    Image = UIImage.FromBundle("personalPhoto"),
    ContentMode = UIViewContentMode.ScaleAspectFill
};
this.View.AddSubview (personImage);

所以你知道是什么问题吗..请给我一些帮助..

提前感谢..

【问题讨论】:

    标签: ios iphone image xamarin uiimageview


    【解决方案1】:

    重新启动您的 iPhone 或模拟器,然后重试。

    您也可以清理(产品 -> 清理)然后重试

    【讨论】:

    • 非常感谢 .. 它使用 (Build -> Clean all)
    猜你喜欢
    • 2014-06-27
    • 2014-11-14
    • 2016-07-01
    • 1970-01-01
    • 2016-10-12
    • 2015-07-25
    • 2018-04-05
    • 2013-01-11
    相关资源
    最近更新 更多