We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

segmented control FontColor and clear selection

Hi can you please check your example is not working
segmentedControl.FontColor = Color.Red;

and please is it possible to unselect an item if i clck on it when it is selected? i need to be able to have no one item selected
thanks

5 Replies

HM Hemalatha Marikumar Syncfusion Team January 8, 2020 02:37 AM UTC

Hi Luca,

 

Greetings from Syncfusion.

 

We would like to let you know that currently we are revamping our UG document of Native platforms (Xamarin.Android and Xamarin.iOS) SegmentedControl. Changes will be reflected in our Volume 1 Service Pack 1 2020 release which is scheduled to be rolled by end of January 2020.

 

Query : FontColor is not Working:

 

We were able to reproduce the same and currently we have a workaround to resolve the same by setting FontSize of SegmentedControl as per in below code snippet

 

Code Snippet [C#]:

protected override void OnCreate(Bundle savedInstanceState)

        {

            base.OnCreate(savedInstanceState);

            SfSegmentedControl segmentedControl = new SfSegmentedControl(this);

            segmentedControl.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 300);

            segmentedControl.SelectionTextColor = Color.Green;

            segmentedControl.FontColor = Color.Red;

            segmentedControl.FontSize = 15;

            List<SfSegmentItem> clothList = new List<SfSegmentItem>()

            {

                new SfSegmentItem(){Text = "Item 1"},

                new SfSegmentItem(){Text = "Item 2"}

            };

 

 

            segmentedControl.ItemsSource = clothList;

            segmentedControl.SegmentHeight = 60;

            segmentedControl.SelectionIndicatorSettings = new SelectionIndicatorSettings()

            {

                Position = SelectionIndicatorPosition.Bottom,

                StrokeThickness = 2

               

            };

            segmentedControl.VisibleSegmentsCount = 3;

            segmentedControl.DisplayMode = SegmentDisplayMode.Text;

            SetContentView(segmentedControl);

        }

 

Query : is it possible to unselect an item if i clck on it when it is selected?

 

Currently we don’t have a toggle option selection in SegmentedControl. Once SegmentedItem has been selected that selection on same item has been ignored.

 

Query: i need to be able to have no one item selected

 

If your requirement is to clear the entire the selection on segmented control then, it has been achieved by setting – 1 as SelectedIndex property of SegmentedControl.

 

Please check and let us know if you need any further assistance.

 

Regards,

Hemalatha M.

 

 



LU Luca January 10, 2020 12:56 PM UTC

hi, thanks.
it is not clear what i should do.
 i put this

 segmentedControl.FontColor = Color.Red;

segmentedControl.FontSize = 15;

 but it doesn't work.

thanks



HM Hemalatha Marikumar Syncfusion Team January 13, 2020 10:33 AM UTC

Hi Luca, 
 
We have validated your query and we would like to let you know that the SegmentedControl FontColor property is working fine at our end. Please find the tested sample from the below location. 
 
 
Screenshot: 
 
 
As we can't know your exact application scenario and couldn't replicate the issue in your case. Could you please let us know whether you are populating the data source as String or CustomViews in your application? If possible, can you please revert us by modifying the sample based on your application along with replication procedure or provide full code snippet for segmented control. This will be helpful for us to provide you better solution at the earliest.  
 
Regards, 
Hemalatha M. 



SR Scott Roberts January 31, 2022 08:03 PM UTC

Hi,


We also have a need to clear the selected item when the item is clicked up.   Do you have any suggestion on how to accomplish this?


Thanks,

Scott



SS Suganya Sethuraman Syncfusion Team February 1, 2022 02:08 PM UTC

Hi Scott,

Currently, we don't have a support to achieve your requirement. We would like to inform you that we have considered this as feature request “Provide the unselection support for SegmentedItem in SfSegmentedControl” and you can track the status of this feature implements through the below link.

Feedback link: https://www.syncfusion.com/feedback/32336  

Please cast your vote to make it count. We will prioritize the features every release based on the demands, and we do not have an immediate plan to implement this feature since we committed with already planned work. So, this feature will be available in any of our upcoming releases. 

If you have any more specifications/suggestions to the feature request, you can add it as a comment in the portal.

Regards,
Suganya Sethuraman.
 


Loader.
Live Chat Icon For mobile
Up arrow icon