3

UIKeyBoardTypeNamePhonePad を使用して、文字と数字だけを入力できるようにしています。必要な機能がいくつかありません。まず、入力するすべての文字を大文字にする必要があります。テキストビューに入ると変更できますが、ユーザーが大文字の入力方法で混乱することは望ましくありません。また、キーボードが最初にポップアップしたときに数字パッドが表示されるようにします。この機能を実現する方法について、私を正しい方向に向けてもらえますか? キーボードは標準の UITextField で使用されています。

ありがとう

4

1 に答える 1

3

According to the class reference, UITextField implements the UITextInputTraits protocol. You can set the autocapitalization type using this:

[myTxtFld setAutocapitalizationType:UITextAutocapitalizationTypeAllCharacters];

You can set the keyboard type:

[myTxtFld setKeyboardType:UIKeyboardTypeNumberPad];

Have a look at this: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITextInputTraits_Protocol/Reference/UITextInputTraits.html

于 2010-02-24T17:18:14.027 に答える