UIKeyboard UIKeyboard Class

Definition

The iPhone virtual keyboard.

[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static class UIKeyboard
type UIKeyboard = class
Inheritance
UIKeyboardUIKeyboard
Attributes

Remarks

The UIKeyboard class contains constants and methods to track the visibility of the iPhone virtual keyboard. iOS posts a number of notifications when the keyboard is shown, hidden or moved in the screen.

The preferred way of receiving UIKeyboard notification is to use the UIKeyboard.Notifications class, which provides a strongly-typed set of APIs to track the changes to the keyboard state and provides strongly-typed accessors to the various parameters of the keyboard changes.


//
// Lambda style
//

// listening notification = UIKeyboard.Notifications.ObserveDidChangeFrame ((sender, args) => { /* Access strongly typed args */ Console.WriteLine ("Notification: {0}", args.Notification);

Console.WriteLine ("FrameBegin", args.FrameBegin);
Console.WriteLine ("FrameEnd", args.FrameEnd);
Console.WriteLine ("AnimationDuration", args.AnimationDuration);
Console.WriteLine ("AnimationCurve", args.AnimationCurve);

});

// To stop listening: notification.Dispose ();

// // Method style // NSObject notification; void Callback (object sender, UIKit.UIKeyboardEventArgs args) { // Access strongly typed args Console.WriteLine ("Notification: {0}", args.Notification);

Console.WriteLine ("FrameBegin", args.FrameBegin);
Console.WriteLine ("FrameEnd", args.FrameEnd);
Console.WriteLine ("AnimationDuration", args.AnimationDuration);
Console.WriteLine ("AnimationCurve", args.AnimationCurve);

}

void Setup () { notification = UIKeyboard.Notifications.ObserveDidChangeFrame (Callback); }

void Teardown () { notification.Dispose (); }

Properties

AnimationCurveUserInfoKey AnimationCurveUserInfoKey

Represents the value associated with the constant UIKeyboardAnimationCurveUserInfoKey

AnimationDurationUserInfoKey AnimationDurationUserInfoKey

Represents the value associated with the constant UIKeyboardAnimationDurationUserInfoKey

BoundsUserInfoKey BoundsUserInfoKey

Represents the value associated with the constant UIKeyboardBoundsUserInfoKey

CenterBeginUserInfoKey CenterBeginUserInfoKey

Represents the value associated with the constant UIKeyboardCenterBeginUserInfoKey

CenterEndUserInfoKey CenterEndUserInfoKey

Represents the value associated with the constant UIKeyboardCenterEndUserInfoKey

DidChangeFrameNotification DidChangeFrameNotification

Notification constant for DidChangeFrame

DidHideNotification DidHideNotification

Notification constant for DidHide

DidShowNotification DidShowNotification

Notification constant for DidShow

FrameBeginUserInfoKey FrameBeginUserInfoKey

Represents the value associated with the constant UIKeyboardFrameBeginUserInfoKey

FrameEndUserInfoKey FrameEndUserInfoKey

Represents the value associated with the constant UIKeyboardFrameEndUserInfoKey

IsLocalUserInfoKey IsLocalUserInfoKey
WillChangeFrameNotification WillChangeFrameNotification

Notification constant for WillChangeFrame

WillHideNotification WillHideNotification

Notification constant for WillHide

WillShowNotification WillShowNotification

Notification constant for WillShow

Methods

AnimationCurveFromNotification(NSNotification) AnimationCurveFromNotification(NSNotification)

Deprecated: helper method to extract the animation curve from a notification.

AnimationDurationFromNotification(NSNotification) AnimationDurationFromNotification(NSNotification)

Deprecated: helper method to extract the animation duration from a notification.

BoundsFromNotification(NSNotification) BoundsFromNotification(NSNotification)

Developers should not use this deprecated method.

CenterBeginFromNotification(NSNotification) CenterBeginFromNotification(NSNotification)

Deprecated: helper method to extract the center start from a notification

CenterEndFromNotification(NSNotification) CenterEndFromNotification(NSNotification)

Deprecated: helper method to extract the center end from a notification.

FrameBeginFromNotification(NSNotification) FrameBeginFromNotification(NSNotification)

Deprecated: helper method to extract the keyboard's starting frame from a notification

FrameEndFromNotification(NSNotification) FrameEndFromNotification(NSNotification)

Deprecated: helper method to extract the keyboard's ending frame from a notification

Applies to

See also