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
KeyboardStateChangedevent that is provided byXKeyboard.Currentand listen to triggered changes. This event sendsKeyboardStateEventArgsas argument, which containsKeyboardEventTypeand 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
