question

njsokalski avatar image
0 Votes"
njsokalski asked ·

Landscape Keyboard Uses Full Screen

I have an EditText that uses a standard numeric keyboard. However, it looks very strange (and ugly) when the device is in landscape. Here are screenshots of portrait & landscape:
79896-screenshot-1616361981.png

79897-screenshot-1616361960.png
Notice that in portrait, the EditText is unchanged from when it is not being edited, but in landscape it fills the entire remaining space of the screen not used by the keyboard. Why does the keyboard (and the EditText itself) look so strange in landscape, and how can I fix it? Thanks.


dotnet-android
10 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

njsokalski avatar image
0 Votes"
njsokalski answered ·

I think you misunderstood my problem. The problem is the fact that in Landscape the entire part of the screen not used by the keys is filled with an area (sort of like a big EditText or something) in which the text is input. I want Landscape to display the keyboard and leave everything else as is, just like it does in Portrait. But I found a solution, which is to include flagNoExtractUi as part of the android:imeOptions property for EditText. This fixed the problem. Hopefully it can help someone else as well.

10 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JessieZhang-2116 avatar image
0 Votes"
JessieZhang-2116 answered ·

Hello,


Welcome to our Microsoft Q&A platform!

It is important to consider how your application will be used and how landscape orientation can be incorporated to improve the user experience. Individual layouts can be designed to accommodate multiple orientations and best use the available space. At the application level, rotation can be disabled or enabled.

By default, Android XML (AXML) files included in the Resources/layout folder are used for rendering views for an Activity. This folder's resources are used for both portrait and landscape orientation if no additional layout resources are provided specifically for landscape.

In addition to the layout folder (which defaults to portrait and can also be explicitly named layout-port by including a folder named layout-land), an application can define the views it needs when in landscape without any code changes.

80055-image.png

For more details,, you can check document : https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/handling-rotation

And there is a sample at the botton of above document , you can check it here: https://docs.microsoft.com/en-us/samples/xamarin/monodroid-samples/applicationfundamentals-rotationdemo/


Best Regards,

Jessie Zhang


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.



image.png (9.5 KiB)
10 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.