resignfirstresponder

UITableView reloadData automatically calls resignFirstResponder

五迷三道 提交于 2019-11-27 12:18:16
I have this UITableView with custom cells that can get only predefined values, therefore I use a UIPickerView as their inputView. All is jolly good until I edit a field and need to show its updated value. In order to make things clearer and easier to maintain, I made delegates and data sources as separate classes, and use notifications to make them interact with the tableView. So, after a value has been chosen from the UIPickerView, the tableView's data source gets notified, and in turn notifies the main ViewController that holds a reference to the tableView. From there I call [_tableView

Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?

淺唱寂寞╮ 提交于 2019-11-26 21:47:34
I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don't know the exact duration and animation type of the keyboard, so it's really bumpy. Here's what I have: [theTextView resignFirstResponder]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:0.25]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; // Frame changes go here (move down 216px) [UIView commitAnimations]; [theTextView becomeFirstResponder]; [UIView beginAnimations:nil context:NULL];

Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?

泄露秘密 提交于 2019-11-26 08:05:10
问题 I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don\'t know the exact duration and animation type of the keyboard, so it\'s really bumpy. Here\'s what I have: [theTextView resignFirstResponder]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:0.25]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; // Frame changes go here (move down 216px)