![](/img/trans.png)
[英]Mac Xamarin.Forms shows image on iOS simulator but not Android simulator
[英]Background shows on iOS but not on Android 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。 除非那是錯誤的? 我究竟做錯了什么?
不要在Android資產文件名中使用破折號,下划線可以正常工作,因此請重命名...
Background-1.jpg
至
Background_1.jpg
...在您的代碼和所有項目中,否則使用OnPlatform
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.