Simple cross platform plugin to get keyboard events and keyboard height on CrossPlatform level.
NOTE: Restoring package will give warning of using .NETFramework but it will work perfectly fine.
Available on NuGet: Xam.CrossKeyboard
- Install nuget package
- Subscribe to
KeyboardStateChanged
event that is provided byXKeyboard.Current
and listen to triggered changes. This event sendsKeyboardStateEventArgs
as argument, which containsKeyboardEventType
and current visibleKeyboardHeight
.
KeyboardEventTypes can be: WillShow
, DidShow
, WillHide
, DidHide
.
XKeyboard.Current.KeyboardStateChanged += Current_KeyboardStateChanged;
private void Current_KeyboardStateChanged(object sender, KeyboardStateEventArgs e)
{
KeyboardHeight = e.KeyboardHeight.ToString();
KeyboardEventType = e.EventType.ToString();
}
For more detailed sample click here
The MIT License (MIT). See License File