背景显示在iOS上,但不在Android Xamarin上

时间:2017-08-02 19:46:27

标签: android ios xaml xamarin

背景图片显示在我的iOS项目中,但不会显示在Android中。我对Xamarin很新,所以这可能是一个非常简单的错误。

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="Simple_Project.Views.ItemDetailPage"
         Title="{Binding Title}"
         BackgroundImage="Background-1.jpg">
    <ScrollView>
        <StackLayout Spacing="20" Padding="15">
           <!--content here-->
        </StackLayout>
    </ScrollView>
</ContentPage> 

我当时认为BackgroundImage会处理iOS和Android。除非那是错的?我究竟做错了什么?

1 个答案:

答案 0 :(得分:2)

不要在Android资源文件名中使用短划线,强调工作正常,因此重命名...

Background-1.jpg

Background_1.jpg

...在您的代码和所有项目中,否则使用OnPlatform