zoukankan      html  css  js  c++  java
  • UITextField的代理方法

    - (void)textFieldDidBeginEditing:(UITextField *)textField

     当textField开始编辑的时候调用,可用完成如下的需求:点击textField可以使页面往上滑动 必须加上这句代码 

    [UIView animateWithDuration:.25 animations:^{

            _scrollView.contentOffset = CGPointMake(0, 75);

        }];

    - (void)textFieldDidEndEditing:(UITextField *)textField

     当textField编辑完成,点击键盘时调用的方法,可以使页面滑动到原来的位置,必须加上这句代码 

    [UIView animateWithDuration:.25 animations:^{

            _scrollView.contentOffset = CGPointMake(0, 0);

        }];

    博主属于菜鸟,只能从点滴做起,望大神指点。博客写的很烂,但是也得硬着头皮发!!!

    1
  • 相关阅读:
    【HDOJ】1811 Rank of Tetris
    【HDOJ】1518 Square
    日期类 Date
    RunTime
    System 系统类
    StringBuffer
    获取联系人列表的时候contact_id出现null的值
    String类
    object类
    eclipse使用的步骤
  • 原文地址:https://www.cnblogs.com/fantasy3588/p/4660607.html
Copyright © 2011-2022 走看看