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
close icon

HintLabelStyle didnt work , need example to set the TextColor


im trying to set a hintlabelstyle to the propertie HintLabelStyle

<textInputLayout:SfTextInputLayout Hint="Vereinbart Am"

this is the style wich is not working:

            <!-- HintLabelStyle -->
            <Style x:Key="HintLabelStyleDefault" TargetType="textInputLayout:LabelStyle">
                <Setter Property="TextColor" Value="Black"/> <<<<< 'this value TextColor didnt exist at LabelStyle'

How is the style correct i need to change the TextColor of the Hint in the SfTextInputLayout.

Greets Johannes

3 Replies

RA Rachel A Syncfusion Team January 3, 2020 06:21 AM UTC

Hi Johannes, 
Greetings from Syncfusion. 
We have provided support to set the text color for the hint by specifying the keys in theme dictionary as provided in the below code snippet. 
                    <x:String x:Key="SfTextInputLayoutTheme">CustomTheme</x:String> 
                    <Color x:Key="SfTextInputLayoutHintColor">Red</Color> 
                    <Color x:Key="SyncPrimaryLightColor">Red</Color>                  
Also, to know more about customization using themes check the below documentation link. 

JR Jassim Rahma replied to Rachel A November 10, 2021 09:14 PM UTC


What if I want to set for specific control?

For example if I have two SfTextInputLayout, TextBoxSigninEmailAddress and TextBoxSigninMobile:

<SyncfusionInputLayout:SfTextInputLayout HeightRequest="60" Hint="Email Address" ContainerType="Outlined">
    <Entry x:Name="TextBoxSigninEmailAddress" IsTextPredictionEnabled="False" Keyboard="Email" FlowDirection="LeftToRight" HorizontalTextAlignment="Center" />

<SyncfusionInputLayout:SfTextInputLayout HeightRequest="60" Hint="Email Address" ContainerType="Outlined">
    <Entry x:Name="TextBoxSigninMobile" IsTextPredictionEnabled="False" Keyboard="Number" FlowDirection="LeftToRight" HorizontalTextAlignment="Center" />

and I want to set the color of TextBoxSigninEmailAddress's Hint to Red but TextBoxSigninMobile to Black because TextBoxSigninEmailAddress is a Required field.

Also, the TextBoxSigninMobile will be Blackin Light and White in Dark

Kindly help..



ET Eswaran Thirugnanasambandam Syncfusion Team November 11, 2021 02:13 PM UTC

Hi Jassim, 
Greetings from Syncfusion. 
Query 1: What if I want to set color for specific control? 
We have checked your requirement and we would like to inform you that, in 2021 Volume 3 main release ( version) we have included the support for changing the hint label color using the Color property of the LabelStyle. So, you can use this instead of our theme dictionary support which is earlier suggested in this thread. Please find the snippet below. 
<SyncfusionInputLayout:SfTextInputLayout HeightRequest="60"  
                                                                              Hint="Email Address"  
        <SyncfusionInputLayout:LabelStyle Color="Red"   
    <Entry x:Name="TextBoxSigninEmailAddress"  
                 HorizontalTextAlignment="Center" /> 
The Volume 3 Main release notes link is provided below. 
Please refer to the below user guide documentation for applying color to the hint label 
We have prepared a sample to achieve your requirement and please get the sample from the below link. 
Please check the sample let us know if you need any further assistance.  
Query 2: The TextBoxSigninMobile will be Blackin Light and White in Dark 
This requirement can be achieved by using the default Hint label color and it will be changed based on the theme since we are using Xamarin forms label as hint label. If the hint label color is set as Black, then we have to change the color value based on the theme using Dynamic Resource. 

Live Chat Icon For mobile
Up arrow icon