我試圖設置ContentsPage BackgroundImage,但在大型屏蔽設備上圖像保持平鋪。Xamarin Forms ContentPage背景圖片拼貼
有沒有人知道如何停止平鋪圖像?
EDITED
這裏是發生了什麼在iPad上的圖像。
這就是它看起來像在手機上:
MainPage.cs
namespace Application.Views
{
public partial class MainPage : ContentPage
{
RegisterDevice registerDevice;
MenuAnimations menuAnimations;
private double width;
public MainPage()
{
InitializeComponent();
registerDevice = new RegisterDevice();
menuAnimations = new MenuAnimations();
ToolbarItems.Add(new ToolbarItem
{
Icon = "menuBtn.png",
Order = ToolbarItemOrder.Primary
});
}
protected override void OnSizeAllocated(double width, double height)
{
BackgroundImage = "bg_portrait.png";
}
}
}
MainPage.xaml中
<?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="Application.Views.MainPage">
<ContentPage.Content>
</ContentPage.Content>
</ContentPage>
請加上屏幕截圖。 –
我已經添加了iPad的屏幕截圖。 – ADuggan
請添加'XAML'代碼。以及它應該如何看起來(從較小的設備屏幕)。謝謝。 –