How can i handle multiple layers ?

Hi , I'm just started digging in xamarin and sometmies i get confused .
Im using Xamarin Forms Project.
This is my simple login page , i create grid for my backgorund pic , 2 Entry's for login and pass. and button for confirming.

This is how looks my page:
` public class LogInPage : ContentPage
{
public LogInPage()
{

        Title = "Log In";

        bool loged = false;
        var button = new Button
        {

            Text = "Log In",
            BackgroundColor = Color.Black,
            TextColor = Color.White

        };
        var MyEntryLogin = new Entry { Text = "Podaj Login", TextColor = Color.White };
        var MyEntryHaslo = new Entry { Text = "Podaj Hasło", TextColor = Color.White};
        button.Clicked += (sender, args) => {
            loged = !loged;
            button.Text = $"Loged {loged}";
        };

        button.Opacity = 0.1;
        MyEntryLogin.Opacity = 0.9;
        MyEntryHaslo.Opacity = 0.7;

        Grid el = new Grid();
        el.Padding = new Thickness(0);
        el.RowSpacing = 0;
        el.ColumnSpacing = 0;
        el.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1.0, GridUnitType.Star) });
        el.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1.0, GridUnitType.Star) });

        Image im = new Image();

        im.Source = FileImageSource.FromUri(
       new Uri("http://digart.img.digart.pl/data/img/vol1/2/90/download/4881142.jpg"));
        im.Aspect = Aspect.Fill;

        el.Children.Add(im, 0, 0);




        Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Children = {

                   el,
                   MyEntryLogin,
                   MyEntryHaslo,
                   button,
                    }

            };


    }
}`

But i get this , how can i set up backgroud picture on full screen and in front put Entry's and buttons.

Best Answer

Answers

  • MackIgricMackIgric AUMember

    Thank You

Sign In or Register to comment.