弹出键盘时,让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;
}
知识慢慢积累,刚开始会感觉好累,时间长了,积累知识多了,以后的工作也会轻松很多....