zoukankan      html  css  js  c++  java
  • textField 视图的上升/下降 => 用协议方法控制

    • 遵守代理,实现以下方法。
    // 开始编辑
    - (void)textFieldDidBeginEditing:(UITextField *)textField {
    
    	// 获取当前视图的 frame
    	CGRect frame = self.view.frame;
    	frame.origin.y = -53;
    
    	[UIView animateWithDuration:0.5 animations:^{
    		self.view.frame = frame;
    	}];
    }
    
    // 结束编辑
    - (void)textFieldDidEndEditing:(UITextField *)textField {
    
    	CGRect frame = self.view.frame;
    	frame.origin.y = 0;
    
    	[UIView animateWithDuration:0.5 animations:^{
    		self.view.frame = frame;
    	}];
    }
    
  • 相关阅读:
    20191117-STD::讲解及求平均数例题
    计算机网络-ip分类
    游标cursor
    ajax
    django ORM
    urls
    templates
    views
    models
    setting
  • 原文地址:https://www.cnblogs.com/CH520/p/13967209.html
Copyright © 2011-2022 走看看