zoukankan      html  css  js  c++  java
  • ios键盘高度

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    }

    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
          [[NSNotificationCenter defaultCenter]removeObserver:self];
    }
    -(void)keyboardWillShow:(NSNotification*)notification{
        
        NSDictionary*info=[notification userInfo];
        CGSize kbSize=[[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size;
        //
        NSValue *animationDurationValue = [info objectForKey:UIKeyboardAnimationDurationUserInfoKey];
        
        NSTimeInterval animationDuration;
        
        [animationDurationValue getValue:&animationDuration];
        NSLog(@"keyboard changed, keyboard width = %f, height = %f,animationDuration =%f",
              
              kbSize.width,kbSize.height,animationDuration);
        
    }

  • 相关阅读:
    java简单实现MD5加密
    Java用freemarker导出Word 文档
    java 反射(*)
    java解析XML
    JDBC程序实例
    web前端开发-博客目录
    虚拟主机配置
    WAMP运行原理
    WAMP配置
    web前端性能优化总结
  • 原文地址:https://www.cnblogs.com/jiangu66/p/2997492.html
Copyright © 2011-2022 走看看