Ways of changing globally HintFloatMode and fontsize of hint

Hi

Is it possible to change the font size of the hint so that it is easier to read when HintFloatMode is set to "Float" and the control has a value?
If it is possible, can it be done in some sort of template that affects all SfTextInputLayout in the entire application or must it be done on every SfTextInputLayout?
If it is possible to use a sort of template for the font size, is it then also possible to do this for the HintFloatMode so that all SfTextInputLayout in the entire application uses AlwaysFloat?

5 Replies

DV Divya Venkatesan Syncfusion Team February 11, 2020 01:26 PM UTC

Hi Morny, 
 
Greetings from Syncfusion.  
 
You can set the font size for hint and make the hint always floated for all the TextInputLayout by setting the IsHintAlwaysFloated and HintLabelStyle using Style. 
 
Code snippet [Xaml]: 
 
<ContentPage.Resources> 
    <ResourceDictionary> 
        <Style TargetType="inputLayout:SfTextInputLayout"> 
            <Setter Property="IsHintAlwaysFloated" Value="True" /> 
            <Setter Property="HintLabelStyle"> 
                <Setter.Value> 
                    <inputLayout:LabelStyle FontSize="20" /> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="ContainerType" Value="Outlined" /> 
        </Style> 
    </ResourceDictionary> 
</ContentPage.Resources> 
 
Output: 
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Divya Venkatesan 



MO Morny February 12, 2020 10:33 AM UTC

Hi

WAUW Speedy answer thank you, but a bit too quick.

I'm using WPF not UWP, Xamarin, Android or iOS - sorry for clarifying that in my question, but I assumed that the WPF forum indicated that.

By replacing "IsHintAlwaysFloated" and "True" with "HintFloatMode" and "AlwaysFloat" that part of your answer works.

Unfortunately the part regarding font size does not. The property "HintLabelStyle" does not exist in WPF, nor does something with a similar name.

Therefore: Is it possible in WPF to alter the font size of the hint through a template, and if so how?



DV Divya Venkatesan Syncfusion Team February 13, 2020 01:07 PM UTC

Hi Morny, 
  
Sorry for the inconvenience. 
  
Currently we do not have support for customizing hint label style in WPF. However, we suggest you to set FontSize for InputView to increase the font size of hint as shown below. 
  
Code snippets [Xaml]: 
  
<Window.Resources> 
    <ResourceDictionary> 
        <Style TargetType="inputLayout:SfTextInputLayout"> 
            <Setter Property="HintFloatMode" Value="AlwaysFloat" /> 
        </Style> 
  
        <Style TargetType="TextBox"> 
            <Setter Property="FontSize" Value="25" /> 
        </Style> 
    </ResourceDictionary> 
</Window.Resources> 
  
<Grid Margin="0,20"> 
       ... 
    <inputLayout:SfTextInputLayout Grid.Row="0" Hint="Hint"> 
        <TextBox Text="John" /> 
    </inputLayout:SfTextInputLayout> 
  
    <inputLayout:SfTextInputLayout Grid.Row="1" Hint="Hint"> 
        <TextBox Text="John" /> 
    </inputLayout:SfTextInputLayout> 
  
</Grid> 
   
Output: 
  
 
  
  
Please let us know if your requirement is achieved with this solution. 
 
Regards, 
Divya Venkatesan 



MO Morny February 17, 2020 08:43 AM UTC

Hi

Thank you for your answer.

It is the same as I have tried and found is the only solution. It is not optimal as the text has to be increased too much in size, in order for the hint to get the desired size.

It ends up with a compromise between a hint that is smaller than desired and the text being bigger than desired. Not optimal, but it will have to suffice.

Thank you for your help.
/Morny


DV Divya Venkatesan Syncfusion Team February 18, 2020 07:02 AM UTC

Hi Morny, 
 
We have logged a feature request on “Support for customizing font size for Hint in TextInputLayout in WPF” and it can be tracked through our feedback portal link below.      
 
 
We will prioritize the features every release based on the demands and this feature will be available in any of our upcoming releases.     
 
Regards,  
Divya Venkatesan 


Loader.
Up arrow icon