Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Xamarin.Forms;
- namespace LoadingScreen
- {
- class MyContentPage : ContentPage
- {
- public MyContentPage ()
- {
- StackLayout loadingView = new StackLayout
- {
- Orientation = StackOrientation.Horizontal,
- BackgroundColor = Color.Gray,
- Children =
- {
- new ActivityIndicator
- {
- Color = Color.White,
- IsRunning = true,
- VerticalOptions = LayoutOptions.Center,
- WidthRequest = 20,
- HeightRequest = 20
- },
- new Label
- {
- TextColor = Color.White,
- Text = "Loading...",
- VerticalOptions = LayoutOptions.Center
- }
- }
- };
- AbsoluteLayout layout = new AbsoluteLayout
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- { // this is the "existing content" placeholder
- new BoxView { Color = Color.Accent },
- new Rectangle(0,0,1,1),
- AbsoluteLayoutFlags.All
- },
- {
- loadingView,
- new Rectangle(
- 0.5, 0.5,
- AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize),
- AbsoluteLayoutFlags.PositionProportional
- }
- }
- };
- this.Content = layout;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement