私は10個のUITextFieldを持っており、画面全体を占めています。私はそれらを変更したいとき、私は画面の半分にキーパッドを取得するので、私は '隠された'フィールドを変更することはできません。 解決方法を知りましたか?キーパッドが隠れているUITextField
0
A
答えて
1
キーボードが呼び出されたときにフレームを上に動かす必要があります。
- (void)keyboardWillShow:(NSNotification *)aNotification
{
self.frame = CGRectMake(0,-[size of keyboard],self.frame.size.width,self.frame.size.height);
}
0
- (void)textFieldDidBeginEditing:(UITextField *)textField {
if (textField == textField1) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield1.frame = CGRectMake(textfield1.frame.origin.x, (textfield1.frame.origin.y - 100.0), textfield1.frame.size.width, textfield1.frame.size.height);
[UIView commitAnimations];
} else if (textField == textField2) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield2.frame = CGRectMake(textfield2.frame.origin.x, (textfield2.frame.origin.y - 100.0), textfield2.frame.size.width, textfield2.frame.size.height);
[UIView commitAnimations];
}
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
if (textField == textField1) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield1.frame = CGRectMake(textfield1.frame.origin.x, (textfield1.frame.origin.y + 100.0), textfield1.frame.size.width, textfield1.frame.size.height);
[UIView commitAnimations];
} else if (textField == textField2) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
textfield2.frame = CGRectMake(textfield2.frame.origin.x, (textfield2.frame.origin.y + 100.0), textfield2.frame.size.width, textfield2.frame.size.height);
[UIView commitAnimations];
}
タッチで:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{[テキストフィールドresignFirstResponder]。 }
希望はあなたを助けます。
お寄せいただきありがとうございます。
関連する問題
- 1. 仮想キーパッドが画面のデータ要素を隠している
- 2. キーボードの裏に隠れるUITextField
- 3. キーボードがUiTextFieldを隠しているときにスクロール表示
- 4. UITextField(ios)に隠されたキャレット
- 5. UITextField - カスタムキーボードを使用してデフォルトのキーパッドを無効にする方法
- 6. UIToolbarが隠れている
- 7. UITextField SecureTextEntryフィールドは、数字パッドから汎用キーパッドに変更します
- 8. Firefoxのスクロールバーが隠されている
- 9. スクロールバーがレールに隠れている4
- 10. フォームコントロールが隠されている
- 11. ナビゲーションバーの影が隠れている
- 12. ソフトキーボードが隠れているのを隠すためのコード
- 13. キーパッドが有効になっているときにレイアウトをプッシュアップ
- 14. Windowsキーパッドのキーコードが機能しない
- 15. Numlockキーパッドが動作していないvb.netのテキストボックス?
- 16. キーボードがpushViewControllerに隠れていない
- 17. UIPickerView:キーボードが隠れていない
- 18. win10 UWPオンスクリーンキーボードが隠れていない
- 19. UITextFieldが辞任していないキーボード
- 20. SKSceneでUITextFieldが表示されない
- 21. UITextFieldデリゲートメソッドが呼び出されない
- 22. キーパッドが数秒間フリーズする
- 23. ナビゲーションバーが隠されています
- 24. カスタムプログレスダイアログが隠されていません
- 25. Navタグが隠されています
- 26. ボリュームコントロールが隠されています
- 27. ボトムタブが隠されています
- 28. UITableView onTouch hideキーパッド
- 29. UITextfieldのクリアボタンは、キーボードが内部にあるときにキーボードを隠す。
- 30. UIScrollViewがスクロールダウンされ、キーパッドがインタラクティブにドラッグされている間、キーボードの高さを検出します。
テキストフィールドのスクロールビューを使用すると、テキストフィールドをクリックするたびにキーボードが表示されます。 – rishi