How can I ignore suggestions in keyboard

I want to ignore keyboard suggestions in my android app

Answers

  • M_Shah04M_Shah04 USMember ✭✭✭
    edited December 2018

    You can refer this:
    https://stackoverflow.com/questions/41338767/can-i-prevent-keyboard-suggestions-from-xamarin-forms

    According to reference above you can try something like this, by using keyboard flags:

    Content = new StackLayout {
    Padding = new Thickness(0,20,0,0),
    Children = {
        new Entry { Keyboard = Keyboard.Create(KeyboardFlags.None) }
    }};
    

    Use keyboard flags: https://docs.microsoft.com/en-us/dotnet/api/Xamarin.Forms.KeyboardFlags?view=xamarin-forms
    Hope this may solve your issue.

  • Nitish1204Nitish1204 Member ✭✭

    Do I need to add anything in bottomlinerenderer file?

  • M_Shah04M_Shah04 USMember ✭✭✭

    @Nitish1204 said:
    Do I need to add anything in bottomlinerenderer file?

    No just try to Give x:Name to your entry like this in your xaml:
    <Entry x:Name="sampleEntry"/>
    and in your xaml.cs:
    sampleEntry.Keyboard = Keyboard.Create(KeyboardFlags.None);

  • Nitish1204Nitish1204 Member ✭✭

    tried the above code but to no use

  • M_Shah04M_Shah04 USMember ✭✭✭
    edited December 2018

    @Nitish1204 said:
    tried the above code but to no use

    I have tried this and its working fine, you can also try this:

    <Entry Placeholder="Code">
         <Entry.Keyboard>
            <Keyboard x:FactoryMethod="Create">
             <x:Arguments>
                <KeyboardFlags>None</KeyboardFlags>
             </x:Arguments>
              </Keyboard>
         </Entry.Keyboard>
      </Entry>
    

    KeyboardFlags.None removes all special keyboard features from the field.

    If still its not working, please share your code what you have implemented, so that I can share other solution.

  • XamarinSampleXamarinSample USMember ✭✭

    Hi Folks
    For me it's not working Below is my code
    <Entry Placeholder="Email"

               Style="{StaticResource MainEntryStyle}"
                       TextChanged="Entry_TextChanged">
                    <Entry.Keyboard>
                        <Keyboard x:FactoryMethod="Create">
                            <x:Arguments>
                                <KeyboardFlags>None</KeyboardFlags>
                            </x:Arguments>
                        </Keyboard>
                    </Entry.Keyboard>
                </Entry>
    
  • ChristopheBERNARDChristopheBERNARD BEMember ✭✭✭✭✭

    Hello @XamarinSample

    why you don't use in the layout this on the edit text ?

    android:inputType="textNoSuggestions"

Sign In or Register to comment.