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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfSegmentedControl with icons - no sample

Thread ID:

Created:

Updated:

Platform:

Replies:

143609 Mar 28,2019 08:37 PM UTC Mar 29,2019 10:03 AM UTC Xamarin.Forms 1
loading
Tags: SfSegmentedControl
Przemyslaw
Asked On March 28, 2019 08:37 PM UTC

Hi,
Your docs in section "Display mode" for SfSegmentCOntrol doesn't make any sense. You wrote that we can populate ItemSource with items to make SfSegmentControl  display Icons and text. There is one problem: there is no way to do that. Even in your sample code in docs you just populate SfSegmentItem with only text, but how ca you add icon? There is no property for icon or something similar.
Please, provide a sample with custom icon and text in Segmented Control.

Regards

Muneesh Kumar G [Syncfusion]
Replied On March 29, 2019 10:03 AM UTC

Hi Przemyslaw,  
 
Greetings from Syncfusion. 
 
We have created a sample for SfSegmentedControl as per your requirement. When DisplayMode is ImageWithText, items populated in control will be displayed as icons with text.  
 
We have IconFont and Text property in SfSegmentItem to set icon and text in SfSegmentedControl. Please check the code snippet for your reference. 
 
Code Snippet: 
 
new SfSegmentItem(){ IconFont = "6", FontIconFontColor = Color.FromHex("#FFFFFF"), FontColor=Color.FromHex("#FFFFFF"), Text = "Day"},  
 
Please use the font.ttf file code on the XAML code as mentioned below. 
  
<buttons:SfSegmentedControl.FontIconFontFamily> 
<OnPlatform x:TypeArguments="x:String"> 
<On Platform="Android" Value="SegmentIcon.ttf" />               
<On Platform="UWP" Value="/Assets/SegmentIcon.ttf#segment2" />                 
<On Platform="iOS" Value="segment2" />          
</OnPlatform>     
</buttons:SfSegmentedControl.FontIconFontFamily> 
 
Please download the sample from the below link: 
 
 
Please refer the following link to know more details about how to set custom font SfSegmentedControl.  
 
 
Please let us know if you have any concern about this. 
 
Regards, 
Muneesh Kumar G. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;