开发者

How to set UIReturnKeyType for iPhone Bundle.settings?

in Settings.bundle I define my app preferences with different fields, some of them are text fields. However when I press on a text field to edit it the keyboard slides up.

My problem is that the keyboard does not disappear. It has a return button. Clicking on it the cursor just jumps to the next text field.开发者_运维问答

I have seen some keyboards that have a done button.

Is it possible to set UIReturnKeyType in Settings.bundle?


Below is the list of keyboard type in iPhone.

 UIKeyboardTypeDefault,
   UIKeyboardTypeASCIICapable,
   UIKeyboardTypeNumbersAndPunctuation,
   UIKeyboardTypeURL,
   UIKeyboardTypeNumberPad,
   UIKeyboardTypePhonePad,
   UIKeyboardTypeNamePhonePad,
   UIKeyboardTypeEmailAddress,
   UIKeyboardTypeDecimalPad,
   UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable

Here is the link to Apple Documentation link.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInputTraits_Protocol/Reference/UITextInputTraits.html#//apple_ref/doc/c_ref/UIKeyboardTypeDefault

you can set the anyone of above .

self.myTextView.keyboardType = UIKeyboardTypeDefault; 


In the interface builder you can choose in the inspector what keyboard you want. If it is a NumberPad , there is no "done" or "return" button.
For to add this button , look into here : http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜