zoukankan      html  css  js  c++  java
  • 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];
    }

  • 相关阅读:
    E-R图转换成关系模型
    折叠表格
    ICE在Linux下的安装
    yum 安装gcc
    dll和so文件区别与构成
    linux进入图形界面的方法
    ACE vs Boost: Singleton的实现
    ACE与ASIO之间关于Socket编程的比较
    Linux 下编译安装ACE时遇到的问题及解决
    Linux下安装、配置ACE
  • 原文地址:https://www.cnblogs.com/A--G/p/4832803.html
Copyright © 2011-2022 走看看