38

私はiPhoneメッセージングベースのアプリで作業しています。

と を使用せinputAccessoryViewずにキーボードでキーボードをキーボードで表示したい。これを行うことは可能ですか?これについて誰か助けてください。UITextViewUITextField

前もって感謝します。あなたの助けを楽しみにしています。ありがとう。

編集:

UITextField/UITextViewとコントロールをUITextView/にしたくないからですUITextField。私はinputAccessoryViewキーボードで追加するつもりですUITextView. UITextviewユーザーがキーボードの に触れるとinputView、実際のプロセスが続行されます。

4

6 に答える 6

20

See the documentation for doing that here:

Simple Text Input

All you need to do is have your view implement UIKeyInput and call [inputView becomeFirstResponder] when the view is touched. Your view also needs to implement canBecomeFirstResponder and return YES.

Sample code from the iOS documentation which does this.

于 2013-08-21T21:08:11.487 に答える
3

これらの他の SO 投稿で回答を試すことができます。

これを試すこともできます:

UIKeyboard *keyboard = [[[UIKeyboard alloc] initWithFrame: CGRectMake(0.0f,          contentRect.size.height - 216.0f, contentRect.size.width, 216.0f)] autorelease];
[keyboard setReturnKeyEnabled:NO];
[keyboard setTapDelegate:editingTextView];
[inputView addSubview:keyboard];
于 2012-10-22T06:34:47.693 に答える
0

ボタンのタッチでテキストフィールドを備えたキーボードを呼び出すことができる小さなユーティリティファイルを作成しました!

https://github.com/havocked/TZKeyboardPop

于 2015-02-20T14:36:20.113 に答える