• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
MJCIOS
博客园    首页    新随笔    联系   管理    订阅  订阅

弹出键盘时,让table向上移动

弹出键盘时,让table向上移动

 #pragma mark UITextFieldDelegate

 

- (BOOL)textFieldShouldBeginEditing: (UITextField *)textField

{

    [UIView beginAnimations: nil context: nil];

    

    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 280, 0);

    

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:textField.tag - tag_index_cell_start inSection: 0];

    

    [self.tableView scrollToRowAtIndexPath: indexPath atScrollPosition: UITableViewScrollPositionBottom

    animated: YES];

    

    [UIView commitAnimations];

    

    return YES;

}

 

知识慢慢积累,刚开始会感觉好累,时间长了,积累知识多了,以后的工作也会轻松很多....
posted @ 2016-05-06 18:06  MJC(IOS)  阅读(169)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3