Removing Text Suggestions for Entry & EditText

Nathan Sokalski 4,106 Reputation points
2020-12-20T03:48:30.34+00:00

I have an Entry in a Xamarin.Forms app, and I want the displayed keyboard to not display suggestions while typing. I have created a Custom Renderer for the Entry, and have tried setting IsSpellCheckEnabled="False" and IsTextPredictionEnabled="False" in the Entry in Xamarin.Forms, and I have tried setting this.Control.InputType = InputTypes.TextFlagNoSuggestions and this.Control.SetRawInputType(InputTypes.TextFlagNoSuggestions) in the Custom Renderer, but neither one seemed to help. What can I do to disable text suggestions for an Entry/EditText? Thanks.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,355 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
    2020-12-21T08:13:42.323+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Try to set InputTypes as TextVariationVisiblePassword, it works fine on my side .

       [assembly : ExportRenderer(typeof(Entry),typeof(MyRenderer))]  
       namespace FormsApp.Droid  
       {  
           class MyRenderer : EntryRenderer  
           {  
               public MyRenderer(Context context):base(context)  
               {  
                     
               }  
         
               protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)  
               {  
                   base.OnElementChanged(e);  
                   if(Control != null)  
                   {  
                       Control.InputType = Android.Text.InputTypes.TextVariationVisiblePassword;  
                   }  
               }  
           }  
       }  
    
    
     
    

    Thank you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.