zoukankan      html  css  js  c++  java
  • UIKeyboardWillShowNotification

    UIKeyboardWillShowNotification 通知来获得当键盘改变时,该键盘的高度和位置。 
    然后调整自己相应的UI元素位置即可,示例代码如下: 
     
     

    -(void)viewDidLoad{ 
       [superviewDidLoad]; 
       [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 

    -(void)viewDidUnload{ 
       [superviewDidUnload]; 
       [[NSNotificationCenter defaultCenter]removeObserver:self]; 

    -(void)keyboardWillShow:(NSNotification*)notification{ 
       NSDictionary*info=[notification userInfo]; 
       CGSize kbSize=[[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size; 
       NSLog(@"keyboard changed, keyboard width = %f, height = %f",  
              kbSize.width,kbSize.height); 
       //在这里调整UI位置 

     
     

  • 相关阅读:
    HMM (隐马尔可夫) 推导 (上)
    图模型初识
    K-means 和 EM 比较
    EM-高斯混合模型
    EM算法-完整推导
    EM算法直观认识
    pandas 之 时间序列索引
    K-Means 算法
    接口。
    第一册:lesson ninety-nine。
  • 原文地址:https://www.cnblogs.com/woaixixi/p/4496897.html
Copyright © 2011-2022 走看看