Skip to content

Instantly share code, notes, and snippets.

@rdavisau
Created June 28, 2019 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdavisau/169468597794df733e6553a3010b1ff9 to your computer and use it in GitHub Desktop.
Save rdavisau/169468597794df733e6553a3010b1ff9 to your computer and use it in GitHub Desktop.
public class BackgroundImagePage : ContentPage
{
public BackgroundImagePage() =>
Content = new Grid // this is the outer grid
{
Children =
{
// this image fills the outer grid and sits behind the 'original' content
new Image { Source = new Uri("https://tinyurl.com/msdevbg"), Aspect = Aspect.AspectFill },
new Grid // this is the 'original' content
{
Children =
{
new Button { Text = "Column 0", BackgroundColor = Color.Black.MultiplyAlpha(.5) }
.Size(120) .Center() .Col(0),
new Button { Text = "Column 1", BackgroundColor = Color.Black.MultiplyAlpha(.5) }
.Size(240) .Center() .Col(1),
}
}
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment