xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] SetImeOptions(ImeFlags.NoFullscreen) does not prevent full screen #7623

Open hartez opened 5 years ago

hartez commented 5 years ago

Description

Steps to Reproduce

  1. Add an Entry x to a page.
  2. Set the NoFullScreen option (x.On<Android>().SetImeOptions(ImeFlags.NoFullscreen);)
  3. Run the application in landscape mode.

Expected Behavior

Focusing the Entry does not display it in full screen with the large "Done" button.

Actual Behavior

Full screen, large "Done" button.

tlaivo commented 3 years ago

Just commenting my findings about this issue.

I noticed that what when I set Control.ImeOptions to ImeFlags.NoFullscreen, Entry work correctly in "NoFullscreen" mode. I tried that even though Android.Views.InputMethods.ImeAction enum does not value NoFullscreen defined.

I'm using Xamarin.Forms v4.8.0.1687. Code: Control.ImeOptions = (Android.Views.InputMethods.ImeAction)ImeFlags.NoFullscreen;

chrisgull commented 3 years ago

I get inconsistent results using either NoFullscreen or NoExtractUI, or combined. On one page it works, on another it doesn't. Xamarin.Forms 5.0.0.1931.

EDIT: Looking at differences between my two pages, NoFullscreen/NoExtractUI doesnt work if Entry.ReturnType is ReturnType.Done, that seems to force the fullscreen mode. Setting ReturnType to ReturnType.Default solved that problem.

yonkahlon commented 2 years ago

Thanks for the work around suggestions! Unfortunately none of them worked for me.

Creating a Customer Entry Renderer worked for me though:

        protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
        {
            base.OnElementChanged(e);

            if (Control != null)
            {
                var element = (MyCustomEntry) Element;
                Control.ImeOptions = (ImeAction)ImeFlags.NoExtractUi;
                Control.SetTextIsSelectable(false);
            }
        }