标签:selector code nil width info bar cto ext value
/** * 监听键盘的弹出和隐藏 */ - (void)keyboardWillChangeFrame:(NSNotification *)note { // 键盘最终的frame CGRect keyboardF = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; // 动画时间 CGFloat duration = [note.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; [UIView animateWithDuration:duration animations:^{ self.toolBar.transform = CGAffineTransformMakeTranslation(0, keyboardF.origin.y - kScreenHeight); }]; } - (void)setupTextWordToolBar{ SinceToolBar *toolbar = [SinceToolBar toolBar]; toolbar.backgroundColor = [UIColor redColor]; toolbar.width = self.view.width; toolbar.height = 44; toolbar.y = self.view.height - toolbar.height; [self.view addSubview:toolbar]; self.toolBar = toolbar; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil]; }
标签:selector code nil width info bar cto ext value
原文地址:http://www.cnblogs.com/HJiang/p/iOS.html