码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2016-05-06 19:36:04      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

弹出键盘时,让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;

}

 

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

标签:

原文地址:http://www.cnblogs.com/MJC-IOS-2010/p/5466584.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!