zoukankan      html  css  js  c++  java
  • 判断键盘的高度

    1、系统键盘跟第三方输入法都可以用这个方法

    //    //增加监听,当键盘出现或改变时收出消息
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillShow:)
                                                     name:UIKeyboardWillShowNotification
                                                   object:nil];
        
        //增加监听,当键盘出现或改变时收出消息
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillHide:)
                                                     name:UIKeyboardWillHideNotification
                                                   object:nil];

    - (void) keyboardWillShow:(NSNotification *)notif
    {
        NSDictionary *info = [notif userInfo];
        NSValue *value = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
        keyBoardHeight = [value CGRectValue].size.height;
        
    //    [UIView animateWithDuration:0.3f animations:^{
    //        _appointCourseTV.contentOffset=CGPointMake(0, keyBoardHeight);
    //    } completion:nil];
        
        
    }
    //回收键盘并落下输入框
    - (void)keyboardWillHide:(NSNotification *)notif
    {
        [_remarkTextView resignFirstResponder];
        [UIView animateWithDuration:0.3f animations:^{
            _appointCourseTV.contentOffset=CGPointMake(0, 0);
        } completion:nil];
        
    //    [UIView animateWithDuration:0.3 animations:^{
    //        
    //        CGRect rect = CGRectMake(0, 0, M_S.width, M_S.height);
    //        
    //        self.view.frame = rect;
    //        
    //    }];
        
    }

  • 相关阅读:
    ajax返回乱码的解决方案
    Javascript里使用Dom操作Xml
    ASP.NET 网站路径
    远程连接SQL Server
    缘 in English
    简单C#验证类
    js事件列表
    ArrayList用法
    下拉菜单遮挡层的解决方案
    正则表达式过滤HTML危险脚本
  • 原文地址:https://www.cnblogs.com/huoxingdeguoguo/p/5037935.html
Copyright © 2011-2022 走看看