In xamarin forms I am making use of hybrid webview to display texarea and entry fields.When I try to enter some data inside the textarea the keyboard pops up and hides the textarea.
Thus I am not able to see the text that i'm typing.It does not auto scroll to the current cursor position.I have read that addingandroid:windowSoftInputMode="adjustResize"
to the android manifest file does the trick.
But is it possible to apply the above property to only the webview(without applying for other views)?Or is there any other way to auto scroll the view so that entry field(cursor)is just above the keyboard.
Please help
In App.xaml.cs
you can add:
using AndroidSpecific = Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
public App()
{
InitializeComponent();
AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, AndroidSpecific.WindowSoftInputModeAdjust.Resize);
…
Which I guess is less idiomatic than Artūras Paleičikas' answer but achieves the same affect.
What about:
protected override void OnCreate(Bundle savedInstanceState)
{
...
global::Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>()
.UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With