我试图设置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'代码。以及它应该如何看起来(从较小的设备屏幕)。谢谢。 –