- Home
- Forum
- Xamarin.Forms
- SfTextInputLayout different Hint and Outline colour/thickness
SfTextInputLayout different Hint and Outline colour/thickness
- Is there a way to have separate colours for the Hint and Outline?
- Can the Hint size and Outline thickness be configured?
Hi Geoff,
Greetings from Syncfusion.
Query 1: Is there a
way to have separate colours for the Hint and Outline?
Yes, you can provide
different color for the Hint and Outline in the SfTextInputLayout using the unique
color key specified in the SyncfusionThemeDictionary. Please refer the below
code snippet.
Reference Link:
https://help.syncfusion.com/xamarin/themes/keys#sftextinputlayout
Code Snippet:
App.xaml:
|
<Application.Resources>
<syncTheme:SyncfusionThemeDictionary>
<syncTheme:SyncfusionThemeDictionary.MergedDictionaries> <ResourceDictionary> <x:String
x:Key="SfTextInputLayoutTheme">CustomTheme</x:String> <Color
x:Key="SyncPrimaryLightColor">Green</Color> <Color
x:Key="SyncPrimaryColor">Red</Color> <Color
x:Key="SfTextInputLayoutHintColor">Blue</Color> <Color
x:Key="SfTextInputLayoutLineColor">Aqua</Color> </ResourceDictionary>
</syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
</syncTheme:SyncfusionThemeDictionary> </Application.Resources>
|
Query 2: Can the Hint size and Outline thickness be
configured?
You can change the
hint size using the FontSize property in the HintLabelStyle property and the
outline thickness can be changed using the FocusedStrokeWidth and UnfocusedStrokeWidth
property. Please check the reference link.
Link:
https://help.syncfusion.com/xamarin/sftextinputlayout/how-to#customize-the-thickness-of-stroke
https://help.syncfusion.com/xamarin/sftextinputlayout/custom-font#hint
Code Snippet:
Xaml:
|
<inputLayout:SfTextInputLayout
Hint="Hint" ContainerType="Outlined"
FocusedStrokeWidth="4" UnfocusedStrokeWidth="4">
<inputLayout:SfTextInputLayout.HintLabelStyle> <inputLayout:LabelStyle
FontSize="15"/>
</inputLayout:SfTextInputLayout.HintLabelStyle> <Entry /> </inputLayout:SfTextInputLayout>
|
We have attached the
sample, please download it from the following location.
Sample: https://www.syncfusion.com/downloads/support/forum/148404/ze/TextInputLayoutSample1790275936
Please let us know if
you need further assistance on this.
Regards,
Lakshmi R.
|
<inputLayout:SfTextInputLayout EnableFloating="False" Hint="Name">
<Entry />
</inputLayout:SfTextInputLayout> |
I am also interested in a solution for outlined entries. I would really like to have the ability to set the hint's background color (while focused) to half blue - half white, considering Mark's example. Is there a way this could be achieved? Thanks in advance.
We have checked your reported query. We would like to inform you that from our current implementation, we can’t give the two colors for the hint background color for the SfTextInputLayout.
- 5 Replies
- 6 Participants
-
GE Geoff
- Oct 17, 2019 08:29 PM UTC
- Dec 15, 2020 11:48 AM UTC