Basically, I have two images in an AbsoluteLayout
, one is a circle (Image1) and the other is another larger circle (Image2), that I want behind it. Right now, it loads both images overlapping each other, but I want to prioritize Image1 to be in front of Image2.
I've looked around in Xamarin.Forms forums regarding how to overlay images. The ones I found close to it were: Overlaying Image on a Page.
But I'm sure there can be a simpler way of putting an image in front of another with a simple method or property, if any in Xamarin.Forms?
Here's the code I have so far:
public NFCPage(Image Image2, Image Image1)
{
this.Image2 = Image2;
this.Image1 = Image1;
this.Image1.Scale = .75;
this.Image2.Source = "circle2.png";
this.Image1.Source = "circle1.png";
new AbsoluteLayout // overlay images
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Start,
MinimumHeightRequest = 10,
Padding = new Thickness(0, 50, 0, 0),
Children =
{
Image1, Image2
}
}
}