This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 336
5.4 KeyboardNotification
tamotamago edited this page May 7, 2013
·
4 revisions
Keyboard Notification User Info Keys
Text, Web, and Editing Programming Guide for iOS
コンテンツを投稿する画面などで Keyboard の表示非表示によってレイアウトを変更する必要がある場面があります。
この際に、UIKeyboardNotification に登録することで、登録したオブジェクトで keyboard 通知を受け取ることが出来るようになります。
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
}
#pragma mark - keyboardNotification
-(void)keyboardWillShow:(NSNotification *)notification
{
NSLog(@"%@", notification.userInfo);
}
console
2013-05-01 11:28:58.903 MixiKeyboardNotificationSample[98874:c07] {
UIKeyboardAnimationCurveUserInfoKey = 0;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 676}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 216}}";
UIKeyboardFrameChangedByUserInteraction = 0;
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
}
下の図の仕様を満たすアプリケーションを作成してください。
ポイント
- keyboardWillHide という通知名でキーボード非表示通知登録
はじめに
-
導入
-
1.3 UIViewController1 UIViewController のカスタマイズ(xib, autoresizing)
-
UIKit 1 - container, rotate-
-
UIKit 2- UIView -
-
UIKit 3 - table view -
-
UIKit 4 - image and text -
-
ネットワーク処理
-
ローカルキャッシュと通知
-
Blocks, GCD
-
設計とデザインパターン
-
開発ツール
-
テスト
-
In-App Purchase
-
付録