Skip to content

Instantly share code, notes, and snippets.

@mattregul
Last active October 9, 2015 16:54
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 mattregul/fe557b784946a80a4e3e to your computer and use it in GitHub Desktop.
Save mattregul/fe557b784946a80a4e3e to your computer and use it in GitHub Desktop.
Multiple Xamarin.Forms ActivityIndicator Colors
using System;
using Xamarin.Forms;
namespace FormsGallery
{
class ActivityIndicatorDemoPage : ContentPage
{
public ActivityIndicatorDemoPage()
{
Label header = new Label
{
Text = "ActivityIndicator",
FontSize = 40,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};
ActivityIndicator activityIndicator01 = new ActivityIndicator
{
Color = Device.OnPlatform(Color.Black, Color.Default, Color.Default),
IsRunning = true,
VerticalOptions = LayoutOptions.CenterAndExpand
};
ActivityIndicator activityIndicator02 = new ActivityIndicator
{
Color = Color.Red,
IsRunning = true,
VerticalOptions = LayoutOptions.CenterAndExpand
};
ActivityIndicator activityIndicator03 = new ActivityIndicator
{
Color = Color.Blue,
IsRunning = true,
VerticalOptions = LayoutOptions.CenterAndExpand
};
ActivityIndicator activityIndicator04 = new ActivityIndicator
{
Color = Color.Green,
IsRunning = true,
VerticalOptions = LayoutOptions.CenterAndExpand
};
ActivityIndicator activityIndicator05 = new ActivityIndicator
{
Color = Color.Purple,
IsRunning = true,
VerticalOptions = LayoutOptions.CenterAndExpand
};
// Build the page.
this.Content = new StackLayout
{
Children =
{
header,
activityIndicator01,
activityIndicator02,
activityIndicator03,
activityIndicator04,
activityIndicator05
}
};
}
}
}