Forum Xamarin.Android

Custom renderer to disable the fullscreen keyboard in Landscape Mode

I have a Text entry input field which needs to displayed as the user inputs the text. In the landscape mode, the onscreen keyboard appears on the whole screen blocking the UI. So I decided to add a custom renderer as shown below:

public class EntryTextRenderer : EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Entry> e)
{
base.OnElementChanged(e);

        if (Control != null)
        {
            // do whatever you want to the textField here!
           // Control.SetBackgroundColor(global::Android.Graphics.Color.DarkGray);
            Control.ImeOptions = (Android.Views.InputMethods.ImeAction)Android.Views.InputMethods.ImeFlags.NoExtractUi;
        }

    }
}

Now the keyboard shows fine without blocking the UI , but the input text is not shown. How do we do both ?
As NoExtractUi option does not show the input. Please help.

Thanks

Answers

  • BillyLiuBillyLiu Member, Xamarin Team Xamurai
    edited February 2018

    Does it not work only when you set the NoExtractUi?
    I have tested your code, it works fine.
    I think you could try to use NoFullscreen instead of NoExtractUi.

  • Thanks for the reply!! It works
Sign In or Register to comment.