- Home
- Forum
- Xamarin.Forms
- SfSegmentedControl.SelectionIndicatorSettings Color has no effect.
SfSegmentedControl.SelectionIndicatorSettings Color has no effect.
I using the latest release version of SfSegmentedControl and the selection color is always blue no matter the color set.
<sfButtons:SfSegmentedControl.SelectionIndicatorSettings>
<sfButtons:SelectionIndicatorSettings Color="Black" CornerRadius="20"/>
</sfButtons:SfSegmentedControl.SelectionIndicatorSettings>
SIGN IN To post a reply.
4 Replies
HM
Hemalatha Marikumar
Syncfusion Team
October 21, 2019 09:22 AM UTC
Hi K Carter,
Greetings from Syncfusion.
We would like to let you know that we were unable to reproduce the reported issue “Provided color for SelectionIndicatorSettings’s Color property is not applied” with the provided code snippet. Please download the tested sample in below
Related UG Link : https://help.syncfusion.com/xamarin/sfsegmentedcontrol/indicating-the-selected-item#selection-strip
Here provided Color value has been applied properly to the Selection indicator of SegmentedControl. Please check with the sample and let us know if the reported issue persists, update us with the following details to check it further and provide a better solution
-
Modified sample of attached sample with replication procedure or
-
Please share the entire code snippet
-
Are you facing this issue only with latest version of SegmentedControl or else in previous version
Regards,
Hemalatha M.
KC
K Carter
October 21, 2019 05:40 PM UTC
Thank you for responding. Looking at your code, I've found the issue causing the problem.
It looks like the problem is caused by the theme being applied "AFTER" the SelectionIndicatorSettings
is being applied.
The SelectionIndicatorSettings are being applied before the theme settings even though the
SelectionIndicatorSettings come "LATER" in the xaml.
<syncfusionTheme:SyncfusionThemeDictionary>
<syncfusionTheme:SyncfusionThemeDictionary.MergedDictionaries>
<syncfusionTheme:LightTheme xaml:Name="LightTheme"/>
</syncfusionTheme:SyncfusionThemeDictionary.MergedDictionaries>
</syncfusionTheme:SyncfusionThemeDictionary>
HM
Hemalatha Marikumar
Syncfusion Team
October 24, 2019 02:07 PM UTC
Hi K Carter,
We have confirmed “SelectionIndicatorSettings Color property does not work when we use themes” as a bug and logged a defect report. The fix for this issue will be available as a patch on 1st November 2019.
Feedback link - https://www.syncfusion.com/feedback/9714/selectionindicatorsettings-color-property-does-not-work-when-we-use-themes
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal link above.
Until you can resolve this issue by setting SyncPrimaryColor in the ResourceDictionary to set Background color of the selectionstrip. Please refer the below code.
Code snippet[XAML]:
|
<ContentPage.Resources>
<syncfusionTheme:SyncfusionThemeDictionary>
<syncfusionTheme:SyncfusionThemeDictionary.MergedDictionaries>
<syncfusionTheme:LightTheme />
<ResourceDictionary>
<Color x:Key="SyncPrimaryColor">Green</Color>
</ResourceDictionary>
</syncfusionTheme:SyncfusionThemeDictionary.MergedDictionaries>
</syncfusionTheme:SyncfusionThemeDictionary>
</ContentPage.Resources> |
Please refer the below link to know the theme setting keys for SfSegmentedControl,
Note - Please update the currently using nuget version of yours to provide a patch for this issue. We only provide patch for Main release and SP release version. We don’t have support to provide patch for weekly nugets and Beta release versions.
Regards,
Hemalatha M.
GR
Geetha Rajendran
Syncfusion Team
November 3, 2019 08:01 AM UTC
Hi K Carter,
Sorry for the inconvenience caused. We have used dynamic resource for themes support in our control. By default, direct property values are not working for nested classes if we set dynamic resource. Since the value set for Color property overridden by dynamic resource value. But we can resolve this issue by setting value for dynamic resource key in control resource as per below code snippet.
|
<buttons:SfSegmentedControl SelectionTextColor="Yellow" FontColor="Red" Color="Pink"
VisibleSegmentsCount="4" SegmentCornerRadius="20" CornerRadius="20"> <buttons:SfSegmentedControl.Resources>
<Color x:Key="SyncPrimaryColor">Black</Color> </buttons:SfSegmentedControl.Resources> <buttons:SfSegmentedControl.SelectionIndicatorSettings>
<buttons:SelectionIndicatorSettings CornerRadius="20" /> </buttons:SfSegmentedControl.SelectionIndicatorSettings> </buttons:SfSegmentedControl> |
Thanks,
Geetha R.
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
KC K Carter
- Oct 19, 2019 07:10 PM UTC
- Nov 3, 2019 08:01 AM UTC