0
votes

I am new to Xamarin Forms. In a Xamarin form page I want to set a background image.

  1. Do I need to store it in PCL or platform specific projects and what are pros and cons for saving in PCL or platform specific.
  2. Do I need to have same image with different resolutions to fit across different devices and different platforms??
1

1 Answers

4
votes

background image in a Xamarin form

public class MainPage : ContentPage{

    public MainPage()
    {
        this.Title = "Example";

        this.BackgroundImage = "EmpMgmtPCL.Images.NPO-Events-bg.png";
    }
}

1) if your working in a cross platform app. PCL y a great alternative. Pross one delopment for multiple os. Cons I don't see any cons yet.

fot you that you are new with xamarin this it's a excelent book to start.

https://developer.xamarin.com/guides/xamarin-forms/creating-mobile-apps-xamarin-forms/

2) read this article https://dzone.com/articles/using-full-size-none-stretched

I hope you have a excelente day. Regards