<Stylex:Name="FieldLabel" ApplyToDerivedTypes="True" CanCascade="True" TargetType="textinputlayout:TextInputHintLabel"> <SetterProperty="FontFamily"Value="{StaticResourceKey=Baloo2-Regular}"/> <SetterProperty="FontSize"Value="18"/> <SetterProperty="BackgroundColor"Value="Red"/> <SetterProperty="FontAttributes"Value="Bold"/> Style>
Only changes the background color for the HintLabel to Red. None of the other fields are applied.
Is there something else I have to do? I Have applied the style nested
<Style ApplyToDerivedTypes="True" CanCascade="True" TargetType="textinputlayout:SfTextInputLayout"> <SetterProperty="HintLabelStyle"Value="{StaticResourceKey=FieldLabel}"/> Style>
and I have tried applying the style directly
<textinputlayout:SfTextInputLayout ContainerType="Outlined" Hint="Manufacturer" HintLabelStyle="{StaticResourceKey=FieldLabel}" ShowHint="True">
However if I set it in the code behind
mfgInput.HintLabelStyle=newSyncfusion.XForms.TextInputLayout.LabelStyle(){FontSize=30,FontAttributes=FontAttributes.Bold};
it does apply the text size, attributes, and family, but the other color settings don't seem available there?
Cheers!
|
<Application.Resources>
<ResourceDictionary>
<Style TargetType="{x:Type inputLayout:SfTextInputLayout}">
<Setter Property="HintLabelStyle">
<Setter.Value>
<inputLayout:LabelStyle FontSize="18" FontAttributes="Bold">
<inputLayout:LabelStyle.FontFamily>
<OnPlatform x:TypeArguments="x:String" iOS="Lobster-Regular" Android="Lobster-Regular.ttf#Lobster-Regular" WinPhone="Assets/Fonts/Lobster-Regular.ttf#Lobster" />
</inputLayout:LabelStyle.FontFamily>
</inputLayout:LabelStyle>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources> |
|
<ContentPage.Resources>
<inputLayout:LabelStyle x:Key="HintLabelStyle" FontSize="18" FontAttributes="Bold">
<inputLayout:LabelStyle.FontFamily>
<OnPlatform x:TypeArguments="x:String" iOS="Lobster-Regular" Android="Lobster-Regular.ttf#Lobster-Regular" WinPhone="Assets/Fonts/Lobster-Regular.ttf#Lobster" />
</inputLayout:LabelStyle.FontFamily>
</inputLayout:LabelStyle>
</ContentPage.Resources>
<ContentPage.Content>
<inputLayout:SfTextInputLayout ContainerType="Outlined" Hint="Manufacturer" ShowHint="True" HintLabelStyle="{StaticResource HintLabelStyle}">
<Entry/>
</inputLayout:SfTextInputLayout>
</ContentPage.Content> |
|
<ContentPage.Resources>
<syncTheme:SyncfusionThemeDictionary>
<syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
<ResourceDictionary>
<x:String x:Key="SfTextInputLayoutTheme">CustomTheme</x:String>
<!--Hint Color for focused state-->
<Color x:Key="SyncPrimaryLightColor">red</Color>
<!--Hint Color for default state-->
<Color x:Key="SfTextInputLayoutHintColor">red</Color>
</ResourceDictionary>
</syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
</syncTheme:SyncfusionThemeDictionary>
</ContentPage.Resources> |