Im trying to set the ContentsPage BackgroundImage but on large screened devices the image keeps tiling.
Does anyone here know how to stop images from tiling?
EDITED
Here is an image of whats happening on iPads.

This is what it looks like on a phone:

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>
In respect that BackgroundImage property is of type string I'm not able to use properties of <Image>, Aspect for instance. So I would better do it in XAML:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SuperForms.Samples.Page1">
<ContentView>
<Image Source="https://i.sstatic.net/ajyCo.png"
Aspect="AspectFill"/>
</ContentView>
</ContentPage>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With