uikeyboard

Can I limit the character set for a UITextField?

依然范特西╮ 提交于 2019-12-08 08:17:03
问题 I have a bitmap font which which doesn't have every single character, such as accented characters (é î ü etc) or symbols such as "¥" or © which I'm using to display usernames in a Highscore table for a game. Is it possible to limit the UIKit keyboard to certain characters, or only allow certain characters in the UITextField? Or will I have to roll my own input mechanism? I'm thinking and old school, Arcade style, one letter at a time "thing" would be ok. 回答1: You could try using the following

iOS: How to get the current visible keyboard type?

半城伤御伤魂 提交于 2019-12-08 08:15:02
问题 How do I find out if the keyboard is of type numeric, Twitter, email, etc...? edit: Is there a way to detect keyboard type without using an outlet? 回答1: Consider that you have tow textFields in the ViewController, You will need to implement textFieldShouldBeginEditing method from UITextFieldDelegate protocol, as follows: class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var tfEmail: UITextField! @IBOutlet weak var tfPassword: UITextField! func

iOS: How to get the current visible keyboard type?

99封情书 提交于 2019-12-07 18:02:26
How do I find out if the keyboard is of type numeric, Twitter, email, etc...? edit: Is there a way to detect keyboard type without using an outlet? Ahmad F Consider that you have tow textFields in the ViewController, You will need to implement textFieldShouldBeginEditing method from UITextFieldDelegate protocol, as follows: class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var tfEmail: UITextField! @IBOutlet weak var tfPassword: UITextField! func textFieldDidBeginEditing(_ textField: UITextField) { if textField.keyboardType == .emailAddress { // this is the tfEmail!

Set UIKeyboardAppearance across the whole app

狂风中的少年 提交于 2019-12-07 06:02:55
问题 Is there a useful property in a cocoa-touch project that would allow setting the one-and-only consistent style of keyboard appearance throughout the app? Say I want UIKeyboardAppearanceAlert on all the textFields and textViews I have in my app without directly modifying anything. Is is possible? 回答1: No, it isn't possible. The keyboardAppearance is part of the UITextInputTraits protocol and is not marked as a UIAppearance method. If it was you could do something like: [[UITextField appearance

UIKeyboard not automatically translucent in iOS7

你离开我真会死。 提交于 2019-12-07 05:06:20
问题 I understand that when developing in Xcode 5 with and iOS 7 project, the keyboard that pops up when interacting with a UITextField should be translucent and show through any colors in the background. This is not the case in both my projects. I have a colored & blurred background and I'm hoping for that to transpire through the keyboard; however the keyboard remains the default white/gray. This is what I have so far as a demo: UIColor *tintColor = [UIColor colorWithWhite:0.21 alpha:0.4];

how move view up when keyboard appears in iPad?

女生的网名这么多〃 提交于 2019-12-06 16:49:32
问题 When the iPad virtual keyboard appears, it covers some of the textfields in my View. Is there a way to move the ViewController up when the keyboard appears?. 回答1: My suggestion is to place your objects on a UIScrollView , then when the keyboard appears, you can use scrollRectToVisible: . [scroller scrollRectToVisible:frame animated:YES]; 回答2: I have wrote this code for one of my Application. It automatically detects the Position of the TextField and Scroll the baseView Accordingly. - (void

Can I create custom keyboard in iPhone?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 16:05:08
问题 Is it allowed to create a custom keyboard. Will apple approve my app if I used my own keyboard instead of using default one. howsoever I don't have button images, I guess I need to use same default keyboard images do so. Is there any image repository where I can get exact keypad button icon. Thanks 回答1: They will almost undoubtedly reject your app. 回答2: The iPad Human Interface Guidelines that iPhone OS 3.2 supports keyboard customization http://developer.apple.com/iphone/library

Resize and move UITableViewCell smoothly without dismissing keyboard

久未见 提交于 2019-12-06 15:28:54
问题 I have got a UITextView inside a UITableViewCell. As the user edits the UITextView text, I resize the UITextView and I need to resize the UITableViewCell and also make sure the UITableViewCell is always above the keyboard. To resize the UITableViewCell without dismissing the keyboard I am doing the following and it works just fine: [tableView beginUpdates]; [tableView endUpdates]; To move the tableView up and have the cell visible above the keyboard I am doing the following and it works just

UIKeyboardWillChangeFrame and iPhone X

爱⌒轻易说出口 提交于 2019-12-06 14:08:19
问题 Trying with simulator here, and it seems that the frame returned when listening for changes with UIKeyboardWillChangeFrame is incorrect for iPhone X. Specifically the frame seems to be a bit taller than it actually is (visibly) on screen. I'd say the returned frame is about 20 points taller. Did I forget something obvious? Some data... The iPhone X and iPhone 8 have the same width in portrait, which makes it the same height in landscape; 375 points. ( https://www.paintcodeapp.com/news

Is there any notification that gets sent when the Keyboard changes (like from NumberPad to Default)

北战南征 提交于 2019-12-06 09:32:11
I am trying to figure out how I can get notified when the keyboard changes. What I am trying to do is add a DONE button to keyboard of type 4 & 5 (NumberPad and PhonePad), everything is working fine, except when I transition from a TextField using a Default KB type, The notification that the KeyboardDidAppear isn't being fired. Here is what I got: - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil]; } Then I added a Property for the current KB type and the current