Position of Hint in large Editors

Hi,

A have a large editor in my XAML page that is enclosed in a SfTextInputLayout:

<sfinputLayout:SfTextInputLayout Hint="Notes">
<Editor Text="{Binding Notes}"
AutoSize="TextChanges"
HeightRequest="200"
MaxLength="1000" />
</sfinputLayout:SfTextInputLayout>

However, the Hint seems to be displayed in the center of the editor.  I would like to display the hint at the top of the editor, which is the behavior of the Placeholder property in the original Editor (not wrapped by the SfTextInputLayout):

<Editor Text="{Binding Notes}"
AutoSize="TextChanges"
Placeholder="Notes"
HeightRequest="200"
MaxLength="1000" />

Is there any way to make the hint appear at the top of the editor and not the center position?

Thanks for your assistance,

Alfredo Diaz


3 Replies 1 reply marked as answer

HM Hemalatha Marikumar Syncfusion Team August 3, 2020 11:54 AM UTC

 
Hi Alfredo, 
 
Greetings from Syncfusion.  
 
We have checked your requirement and we would like to let you know that your requirement has been achieved by enabling IsHintAlwaysFloated property as per in below code snippet 
 
     <textinputlayout:SfTextInputLayout Hint="TextInputLayout hint" IsHintAlwaysFloated="True" > 
                <Editor  
                                   AutoSize="TextChanges" 
                                   Placeholder="Editor Placeholder" 
                                   HeightRequest="200" 
                                   MaxLength="1000" > 
                </Editor> 
            </textinputlayout:SfTextInputLayout> 
 
 


For more reference
 
 
 
Regards,
Hemalatha M. 
 
 



AL Alfredo August 3, 2020 04:07 PM UTC

Hi Hemalatha,

Thank you for your response.  However, this does not achieve the desired result.  What you are suggesting places the Hint with very small letters at the top left, which is what happens when the Editor receives focus.

However, I would like the Hint to appear as large letters on the top left when the Editor is unfocused.  This is the behavior of the Placeholder property for the unwrapped Editor.  I am attaching a zip file with a screen shot to show you what I mean.  The first shows the Placeholder property in a plain Editor, not wrapped by the SfTextInputLayout.  The second shows the Hint property on the same Editor wrapped by the SfTextInputLayout.  Notice the difference in placement when both editors are unfocused.

Can I place the Hint on the top left, just like the Placeholder?

Attachment: Placeholder_vs._Hint.jpg_b694575f.zip


HM Hemalatha Marikumar Syncfusion Team August 4, 2020 02:32 PM UTC

Hi Alfredo, 
 
To achieve your requirement, please use the HintLabelStyle to customize the hint label font setting as per in below code snippet 
 
<inputLayout:SfTextInputLayout Hint="Notes" IsHintAlwaysFloated="True"> 
            <inputLayout:SfTextInputLayout.HintLabelStyle> 
                <inputLayout:LabelStyle FontSize="25"/> 
            </inputLayout:SfTextInputLayout.HintLabelStyle> 
            <Editor   
                                   AutoSize="TextChanges"  
                                   Placeholder="Notes"  
                                   HeightRequest="200"  
                                   MaxLength="1000" > 
            </Editor> 
        </inputLayout:SfTextInputLayout> 
 
Output: 
 
First one is SfTextInputLayout wrapped with Editor; Second one is editor. 
 
 
Regards,
Hemalatha M.
 


Marked as answer
Loader.
Up arrow icon