コード例 #1
0
  @Override
  public void viewDidDisappear(boolean animated) {
    super.viewDidDisappear(animated);

    NSNotificationCenter.getDefaultCenter().removeObserver(UIKit.KeyboardWillShowNotification());
    NSNotificationCenter.getDefaultCenter().removeObserver(UIKit.KeyboardWillHideNotification());
  }
コード例 #2
0
 @Override
 public void viewWillAppear(boolean animated) {
   super.viewWillAppear(animated);
   Selector willShow = Selector.register("keyboardWillShow:");
   Selector willHide = Selector.register("keyboardWillHide:");
   NSNotificationCenter center = NSNotificationCenter.getDefaultCenter();
   center.addObserver(this, willShow, UIKit.KeyboardWillShowNotification(), null);
   center.addObserver(this, willHide, UIKit.KeyboardWillHideNotification(), null);
 }