码迷,mamicode.com
首页 > 其他好文 > 详细

键盘学习笔记

时间:2014-11-18 12:00:27      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:ios   键盘   

- (void)handleKeyboardDidShow:(NSNotification *)notification

{

    NSDictionary *info = [notification userInfo];

    CGRect keyboardFrame;

    [[info objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardFrame];

    CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size;

//    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, kbSize - 20, <#CGFloat width#>, <#CGFloat height#>)]

    CGFloat distanceToMove = kbSize.height;

    NSLog(@"动态键盘高度:%.1f",distanceToMove);

    

    //    if (exitButton == nil) {

    //        exitButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

    //        CGRect exitBtFrame = CGRectMake(self.view.frame.size.width-40, self.view.frame.size.height - distanceToMove, 40.0f, 30.0f);

    //        exitButton.frame = exitBtFrame;

    //        [exitButton setImage:[UIImage imageNamed:@"DoneDown.png"] forState:UIControlStateNormal];

    //        [self.view addSubview:exitButton];

    //

    //    }

    //    exitButton.hidden=NO;

    //    [self adjustPanelsWithKeyBordHeight:distanceToMove];

    //    [exitButton addTarget:self action:@selector(CancelBackKeyboard:) forControlEvents:UIControlEventTouchDown];

}


本文出自 “深圳市联城通科技公司” 博客,请务必保留此出处http://roderickkennedy.blog.51cto.com/6758427/1577769

键盘学习笔记

标签:ios   键盘   

原文地址:http://roderickkennedy.blog.51cto.com/6758427/1577769

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!