简体   繁体   English

设备的键盘在输入上方

[英]Device's keyboard is above the input

I have a Xamarin application using HybridWebView. 我有一个使用HybridWebView的Xamarin应用程序。 Inside of it I have an input at the end of the screen and when I click on it the device's keyboard is above the input, so I cannot see what I am typing. 在它的内部,在屏幕末尾有一个输入,当我单击它时,设备的键盘在输入上方,因此我看不到正在输入的内容。 I figured out how to add height on the screen when the input is clicked, but I believe this is not the most appropriate way to do it. 我想出了如何在单击输入时在屏幕上增加高度,但是我认为这不是最合适的方法。

There is a better way to do it? 有更好的方法吗? Thanks 谢谢

Try thats, I do not remember exactly. 尝试多数民众赞成在我不记得确切。 If I understand the problem rightly, someone will work for them. 如果我对问题的理解正确,就会有人为他们工作。 Please try and write results. 请尝试并写下结果。

android:windowSoftInputMode="adjustPan"

or 要么

android:windowSoftInputMode="adjustNothing"

I found a solution, just put this in the App.cs constructor: 我找到了一个解决方案,只需将其放在App.cs构造函数中:

Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);

Reference: https://bugzilla.xamarin.com/show_bug.cgi?id=50792 参考: https : //bugzilla.xamarin.com/show_bug.cgi?id=50792

Try to use, in your MainActivity's Activity attributes: 尝试在MainActivity的Activity属性中使用:

WindowSoftInputMode = SoftInput.AdjustResize 

or 要么

WindowSoftInputMode = SoftInput.AdjustPan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM