• ios 键盘弹起


    #pragma mark 键盘弹起操作

    - (void)keyboardWillShow:(NSNotification *)notification
    {
        NSDictionary *info = notification.userInfo;
        kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
        [UIView beginAnimations:@"kbmove" context:nil];
        [UIView setAnimationDelay:0.5];
        if (!iPhone5) {
            
            self.view.frame = CGRectMake(0, 0 - kbSize.height + 150, SCREEN_WIDTH, SCREEN_HEIGHT);
            
        }else
        {
            self.view.frame = CGRectMake(0, 0 - kbSize.height + 120, SCREEN_WIDTH, SCREEN_HEIGHT);
        }
        [UIView commitAnimations];
    }

    #pragma mark 键盘消失操作

    - (void)keyboardwillhidden:(NSNotification *)notification
    {
        self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    }

    - (void)createKeyboardNotification
    {
        //键盘通知
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillShow:)
                                                     name:UIKeyboardWillShowNotification object:nil];
        
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardwillhidden:)
                                                     name:UIKeyboardWillHideNotification object:nil];
    }

  • 相关阅读:
    家长如何助力孩子适应小学生活
    一年级线上家长会
    gdb常用调试命令
    二叉树-后序遍历
    机器人
    Oracle创建只读账号的详细步骤
    ORACLE RAC日常运维-调整RAC+DG环境redo大小
    Redis 延迟分析
    oracle dataguard 重启步骤
    catalog start with + switch database to copy的妙用
  • 原文地址:https://www.cnblogs.com/A--G/p/4832803.html
Copyright © 2020-2023  润新知