Xamarin.Forms.CustomSwitch
<switch:CustomSwitch x:Class="Sample.Examples.Other2Switch"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:switch="clr-namespace:Switch;assembly=Switch"
BackgroundColor="White"
CornerRadius="20"
HeightRequest="40"
HorizontalKnobMargin="3"
KnobColor="Red"
KnobColorGradientEndPoint="0.5,1"
KnobColorGradientStartPoint="1,0"
KnobCornerRadius="18"
KnobHeight="36"
KnobLimit="Boundary"
KnobWidth="36"
VibrateDuration="20"
WidthRequest="80">
<switch:CustomSwitch.BackgroundContent>
<StackLayout Orientation="Horizontal">
<Label FontAttributes="Bold"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="Center"
Text="ON"
TextColor="DarkGray"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Label FontAttributes="Bold"
FontSize="12"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="Center"
Text="OFF"
TextColor="DarkGray"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
</StackLayout>
</switch:CustomSwitch.BackgroundContent>
</switch:CustomSwitch>
No comments:
Post a Comment