Xamarin.Forms.SegmentedButton

May 13, 2019 ยท View on GitHub

SegmentedButtonGroup is like iOS Segmented Controls for Xamarin.Forms

This is the component, works on iOS, Android and UWP.
SocialNetworkApp

NuGet

NameInfo
SegmentedButtonNuGet

Platform Support

SegmentedButton is a .NET Standard 2.0 library.Its only dependency is the Xamarin.Forms

install the package in the shared project

in the Xaml file we must declare our control xmlns:sb="clr-namespace:Xamarin.Forms.SegmentedButton;assembly=Xamarin.Forms.SegmentedButton", for example .


  <sb:SegmentedButtonControl DefaultColor="#E06F23" SelectedColor="Black" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}" CornerRadius="5" HeightRequest="50" Margin="8, 8, 8, 0">
                <sb:SegmentedButtonControl.LabelStyle>
                    <Style TargetType="Label">
                        <Setter Property="FontSize" Value="12" />
                        <Setter Property="FontAttributes" Value="Bold" />
                    </Style>
                </sb:SegmentedButtonControl.LabelStyle>
                <sb:SegmentedButtonControl.SegmentedButtons>
                    <sb:SegmentedButton Title="None" />
                    <sb:SegmentedButton Title="First"/>
                    <sb:SegmentedButton Title="Second"/>
                </sb:SegmentedButtonControl.SegmentedButtons>
            </sb:SegmentedButtonControl>

The complete example can be downloaded here: https://github.com/TBertuzzi/Xamarin.Forms.SegmentedButton/tree/master/SegmentedButtonSample