Xamarin:图像未显示在手机中,但显示在模拟器中

时间:2020-08-28 08:58:24

标签: image xamarin.forms xamarin.android

在模拟器中测试时,会显示图标图像,但是在我创建apk并将其安装在手机中之后,它不再显示。这项工作之前但只有在更新一些nuget之后才发生此问题。

OnChangeLegStatusIcon2.Source = "arrived_green_small.png";
OnChangeLegStatusIcon1.Source = "futile_green.png";

<StackLayout Grid.Row="0" Grid.Column="0" HorizontalOptions="Center">
    <Image x:Name="OnChangeLegStatusIcon1" HeightRequest="40">
        <Image.GestureRecognizers>
            <TapGestureRecognizer Tapped="OnChangeLegStatus1" NumberOfTapsRequired="1"/>
        </Image.GestureRecognizers>
    </Image>
    <Label x:Name="OnChangeLegStatusIcon1Label" HorizontalTextAlignment="Center"/>
</StackLayout>
<StackLayout Grid.Row="0" Grid.Column="1" HorizontalOptions="Center">
    <Image x:Name="OnChangeLegStatusIcon2" HeightRequest="40">
        <Image.GestureRecognizers>
            <TapGestureRecognizer Tapped="OnChangeLegStatus2" NumberOfTapsRequired="1"/>
        </Image.GestureRecognizers>
    </Image>
    <Label x:Name="OnChangeLegStatusIcon2Label" HorizontalTextAlignment="Center"/>
</StackLayout>
<StackLayout Grid.Row="0" Grid.Column="2" HorizontalOptions="Center">
    <Image Source="photo_green_small.png" HeightRequest="40">
        <Image.GestureRecognizers>
            <TapGestureRecognizer Tapped="OnCameraClicked" NumberOfTapsRequired="1"/>
        </Image.GestureRecognizers>
    </Image>
    <Label x:Name="CameraLabel" Text="Photo" HorizontalTextAlignment="Center"/>
</StackLayout>

enter image description here

0 个答案:

没有答案