Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.29 KB

File metadata and controls

37 lines (26 loc) · 1.29 KB

Keyboard plugin for Xamarin.Forms

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.

Nuget

Available on NuGet: Xam.CrossKeyboard

Documentation

  1. Install nuget package
  2. Subscribe to KeyboardStateChanged event that is provided by XKeyboard.Current and listen to triggered changes. This event sends KeyboardStateEventArgs as argument, which contains KeyboardEventType and current visible KeyboardHeight.

KeyboardEventTypes can be: WillShow, DidShow, WillHide, DidHide.

Sample

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

License

The MIT License (MIT). See License File

Contributors