Class SfSegmentedControl
SegmentedControl View lets users explore and switch among different views.
Inheritance
Implements
Namespace: Syncfusion.Android.Buttons
Assembly: Syncfusion.Buttons.Android.dll
Syntax
public class SfSegmentedControl : LinearLayout, INotifyPropertyChanged
Constructors
SfSegmentedControl(Context)
Initializes a new instance of the SfSegmentedControl class.
Declaration
public SfSegmentedControl(Context context)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context | Context type |
SfSegmentedControl(Context, IAttributeSet)
Initializes a new instance of the SfSegmentedControl class.
Declaration
public SfSegmentedControl(Context context, IAttributeSet attribute)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context | Context Type |
Android.Util.IAttributeSet | attribute | Attribute sets |
Properties
AutoScrollSelectedItem
Gets or sets the value that indicates whether to enable the auto scrolling when selected index is changed in SfSegmentedControl.
Declaration
public bool AutoScrollSelectedItem { get; set; }
Property Value
Type |
---|
System.Boolean |
BackColor
Gets or sets the background color of the segment in SfSegmentedControl.
Declaration
public Color BackColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
BorderColor
Gets or sets the color of the border for SfSegmentedControl.
Declaration
public Color BorderColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
BorderThickness
Gets or sets the thickness of the border for SfSegmentedControl.
Declaration
public double BorderThickness { get; set; }
Property Value
Type |
---|
System.Double |
CornerRadius
Gets or sets the corner radius value for the border of SfSegmentedControl.
Declaration
public double CornerRadius { get; set; }
Property Value
Type |
---|
System.Double |
DisabledTextColor
Gets or sets the text color of disabled segment items in SfSegmentedControl.
Declaration
public Color DisabledTextColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
DisplayMode
Gets or sets the value to define the type of segment. By default, it will display title from SfSegmentItem or the string value.
Declaration
public SegmentDisplayMode DisplayMode { get; set; }
Property Value
Type |
---|
SegmentDisplayMode |
FontColor
Gets or sets the value for the color of text for a segment item.
Declaration
public Color FontColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
FontIconFontColor
Gets or sets the value for the color of font icon text for a segment item.
Declaration
public Color FontIconFontColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
FontIconFontSize
Gets or sets the value for the font size of icon font text for a segment item.
Declaration
public double FontIconFontSize { get; set; }
Property Value
Type |
---|
System.Double |
FontIconStyle
Gets or sets the value for the font family of icon font text for a segment item.
Declaration
public Typeface FontIconStyle { get; set; }
Property Value
Type |
---|
Android.Graphics.Typeface |
FontSize
Gets or sets the value for the font size of text for a segment item.
Declaration
public double FontSize { get; set; }
Property Value
Type |
---|
System.Double |
ItemsSource
Gets or sets children for SfSegmentedControl through the collection of SfSegmentItem or collection of strings or views.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type |
---|
System.Collections.IEnumerable |
ScrollToPosition
Gets or sets a value for positioning the selected index at a specific position when AutoScrollSelectedItem is set to true.
Declaration
public ScrollToPosition ScrollToPosition { get; set; }
Property Value
Type |
---|
ScrollToPosition |
SegmentBackgroundColor
Gets or sets Segment background color
Declaration
public Color SegmentBackgroundColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
SegmentBorderColor
Gets or sets Segment border color
Declaration
public Color SegmentBorderColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
SegmentBorderThickness
Gets or sets Segment border thickness
Declaration
public double SegmentBorderThickness { get; set; }
Property Value
Type |
---|
System.Double |
SegmentCornerRadius
Gets or sets the corner radius value for the segment items available in SfSegmentedControl.
Declaration
public double SegmentCornerRadius { get; set; }
Property Value
Type |
---|
System.Double |
SegmentHeight
Gets or sets the value for the height of the segment in SfSegmentedControl.
Declaration
public double SegmentHeight { get; set; }
Property Value
Type |
---|
System.Double |
SegmentPadding
Gets or sets Segment border thickness
Declaration
public double SegmentPadding { get; set; }
Property Value
Type |
---|
System.Double |
SegmentWidth
Gets or sets the value for the width of the segment in SfSegmentedControl.
Declaration
public double SegmentWidth { get; set; }
Property Value
Type |
---|
System.Double |
SelectedIndex
Gets or sets the value for current index of SfSegmentedControl.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
SelectionAnimationDuration
Gets or sets the selection animation duration.
Declaration
public double SelectionAnimationDuration { get; set; }
Property Value
Type |
---|
System.Double |
SelectionIndicatorSettings
Gets or sets value to configure the attributes of SelectionIndicatorSettings, Selection indicator is a strip which is used to indicate the selected index of SfSegmentedControl
Declaration
public SelectionIndicatorSettings SelectionIndicatorSettings { get; set; }
Property Value
Type |
---|
SelectionIndicatorSettings |
SelectionTextColor
Gets or sets the text color of the selected segment in SfSegmentedControl.
Declaration
public Color SelectionTextColor { get; set; }
Property Value
Type |
---|
Android.Graphics.Color |
Typeface
Gets or sets the value for the font representation of text for a segment item.
Declaration
public Typeface Typeface { get; set; }
Property Value
Type |
---|
Android.Graphics.Typeface |
VisibleSegmentsCount
Gets or sets the value to show the segments in the available space in SfSegmentedControl. As it overrides to segment width property, other segments can be viewed by scrolling.
Declaration
public Nullable<int> VisibleSegmentsCount { get; set; }
Property Value
Type |
---|
System.Nullable<System.Int32> |
Methods
Dispose(Boolean)
method to dispose dead objects
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | whether indicates disposing or not. |
OnDraw(Canvas)
On draw method.
Declaration
protected override void OnDraw(Canvas canvas)
Parameters
Type | Name | Description |
---|---|---|
Android.Graphics.Canvas | canvas |
OnLayout(Boolean, Int32, Int32, Int32, Int32)
Position all children within this layout.
Declaration
protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | changed | |
System.Int32 | left | |
System.Int32 | top | |
System.Int32 | right | |
System.Int32 | bottom |
OnMeasure(Int32, Int32)
On measure the SfSegmentedControl
Declaration
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | widthMeasureSpec | Width measure spec. |
System.Int32 | heightMeasureSpec | Height measure spec. |
OnSizeChanged(Int32, Int32, Int32, Int32)
method for size changed
Declaration
protected override void OnSizeChanged(int w, int h, int oldw, int oldh)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | w | width |
System.Int32 | h | height |
System.Int32 | oldw | old width |
System.Int32 | oldh | old height |
ScrollTo(Int32, ScrollToPosition)
Scroll the segment item based on the given index and ScrollToPosition.
Declaration
public void ScrollTo(int index, ScrollToPosition scrollToPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
ScrollToPosition | scrollToPosition |
ScrollTo(Object, ScrollToPosition)
Scroll to the segment item based on the provided segment item and ScrollToPosition.
Declaration
public void ScrollTo(object item, ScrollToPosition scrollToPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | |
ScrollToPosition | scrollToPosition |
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |
SelectionChanged
Occurs when selected index changed.
Declaration
public event EventHandler<SelectionChangedEventArgs> SelectionChanged
Event Type
Type |
---|
System.EventHandler<SelectionChangedEventArgs> |