Remove Done button

hello. I'm developing a Xamarin.forms app and using SfChat. I tried to remove Done button over the keyboard when keyboard is focused. I tried to use your code in this thread https://www.syncfusion.com/forums/155966/chat-editor-only and, in OnElementChanged func, I tried to insert:


if (this.Control != null)

{

this.Control.InputAccessoryView = null;

}


but it doesnt' work. Any idea to solve?


1 Reply

DV Diwakar Venkatesan Syncfusion Team August 16, 2023 02:29 PM UTC

Hi Pasquale Mirco, 

We have analysed your requirement “Remove Done button”. We can achieve this requirement in sample level by clearing UITextView InputAccessoryView of Editor using dependency injection in Xamarin forms. Please find the code example for the same.

if (e.PropertyName == "Renderer")

{

    if (Device.RuntimePlatform == Device.iOS)

    {

        DependencyService.Get<IRendererInterface>().DisableButton(this.sfChat.Editor);

    }

}

// iOS renderer

public void DisableButton(Editor editor)
{
    var renderer = Platform.GetRenderer(editor);

    if (renderer != null)
    {
        (renderer as EditorRenderer).Control.InputAccessoryView = null;

    }

}


Also please find the attached sample below for your reference.

Regards,

Diwakar V


Attachment: ChatXamarin_86367e9a.zip

Loader.
Up arrow icon