首页 文章

Xamarin表单不在MVVMCross MvxContentPage中显示图像

提问于
浏览
3

我无法在我的页面中查看任何本 Map 像 . 使用android作为参考,图像被正确放置在Resources / Drawable子文件夹中,但即使使用默认的“icon.png”也没有显示 .

这是我的页面:

<?xml version="1.0" encoding="utf-8" ?>
<mvx:MvxContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                     xmlns:local="clr-namespace:MyApp"
                     xmlns:mvx="clr-namespace:MvvmCross.Forms.Views;assembly=MvvmCross.Forms"
                     x:Class="MyApp.MainPage"
                     BackgroundImage="icon.png">

    <StackLayout Orientation="Vertical">

        <Image Source="icon.png"></Image>
    </StackLayout>
</mvx:MvxContentPage>

这是文件:

Image files location

在构建输出中,我收到以下消息:

[0:] Could not load image named: {0}: icon.png

[0:] FileImageSourceHandler: Could not find image or image file was invalid: File: icon.png

我怀疑这个问题与使用mvxContentPage有关,因为更改为简单的ContentPage并使用Gorilla播放器预览图像按预期显示的页面 .

提前致谢!

1 回答

  • 0

    只需删除 (...).Android\bin 文件夹下的所有内容即可 . VS将重新创建所有内容,这次将包括新图像 .

相关问题