@blog.justoneplanet.info

日々勉強

iOSでキーボードの表示と非表示に応じた処理をする

- (void)keyboardDidShow:(NSNotification *)note {
    // something
}
- (void)keyboardDidHide:(NSNotification *)note {
    // something
}
- (id)init {
    self = [super init];
    if (self) {
        // キーボードが表示された時
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
        // キーボードが隠れた時
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
    }
    return self;
}

コメントはまだありません»

No comments yet.

RSS feed for comments on this post.TrackBack URL

Leave a comment