zoukankan      html  css  js  c++  java
  • iOSview整体上移下移(点击键盘)

    首先创建一个textFiled 并实现起代理方法

     1 - (void)textFieldDidBeginEditing:(UITextField *)textField
     2 {
     3     //设置动画的名字
     4     [UIView beginAnimations:@"Animation" context:nil];
     5     //设置动画的间隔时间
     6     [UIView setAnimationDuration:0.20];
     7     //??使用当前正在运行的状态开始下一段动画
     8     [UIView setAnimationBeginsFromCurrentState: YES];
     9     //设置视图移动的位移
    10     self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y - 200, self.view.frame.size.width, self.view.frame.size.height);
    11     //设置动画结束
    12     [UIView commitAnimations];
    13 }
    14 - (void)textFieldDidEndEditing:(UITextField *)textField
    15 {
    16     //设置动画的名字
    17     [UIView beginAnimations:@"Animation" context:nil];
    18     //设置动画的间隔时间
    19     [UIView setAnimationDuration:0.20];
    20     //??使用当前正在运行的状态开始下一段动画
    21     [UIView setAnimationBeginsFromCurrentState: YES];
    22     //设置视图移动的位移
    23     self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y +200, self.view.frame.size.width, self.view.frame.size.height);
    24     //设置动画结束
    25     [UIView commitAnimations];
    26 }
    27 - (BOOL)textFieldShouldReturn:(UITextField *)textField
    28 {
    29     [_text resignFirstResponder];
    30     return YES;
    31 }
  • 相关阅读:
    python字符串操作
    老男孩购物车程序
    python数据类型,判断,循环
    Matplotlib 绘图参考手册
    numpy 基础知识
    numpy random 模块
    numpy 算术运算
    pandas 读写数据
    python 读写文本
    python--windows文件操作
  • 原文地址:https://www.cnblogs.com/zhanghuanan/p/5611675.html
Copyright © 2011-2022 走看看