uikeyboard

UIKeyboard turn Caps Lock on

与世无争的帅哥 提交于 2019-12-11 11:33:57
问题 I need my user to input some data like DF-DJSL so I put this in the code: theTextField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; But unfortunately what happens is the first to letter type in CAPS but then letter immediately after typing the hyphen will be in lower case and then the rest return to CAPS therefore producing output like this (unless the user manually taps the shift button after typing a hyphen): DF-dJSL How can I fix this? Many Thanks 回答1: You don't

UINPUT device program in C for Ubuntu 14.04 does not work. Why? Part 2:

自古美人都是妖i 提交于 2019-12-11 10:27:46
问题 I am using Ubuntu 14.04, and I am setting up a virtual keyboard in c, which requires uinput to work. My program is supposed to send the key 'a' to terminal, as it would when I would press the 'a' key on the keyboard. Here's my source code: int main() { int uinp_fd; int i; /********** Open uinput file section. **********************/ uinp_fd = open("/dev/uinput", O_WRONLY|O_NDELAY); if(uinp_fd < 0) { printf("Unable to open /dev/uinput\n"); return -1; } else printf("Can open /dev/uinput\n"); /*

How to set Custom keyboard specific to only a UItextfield

允我心安 提交于 2019-12-11 09:06:51
问题 How to set Custom keyboard specific to only a UITextField ? When I am changing using this method, all the keyboards in my application are changed to this new custom keyboard. I added: [[NSNotificationCenter defaultCenter] addObserver:self.view selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; in a UIViewController . But after going to that UIView , keyboards in other UIViewController s also look like new custom keyboard. How can i limit the custom keyboard

KeyboardWillShow only moves container UIView for certain UITextFields

风格不统一 提交于 2019-12-11 08:49:10
问题 I have a container UIView that contains a UICollectionView and a UIView, both of which have UITextFields in them. I used NSNotificationCenter to move the container view when the keyboard pops up. However, it only seems to work for the UICollectionView but not the sub UIView, as shown in the screenshots: works fine for the text fields in UICollectionView: but doesn't work for the text field in the UIView: EDIT: related code: override func viewWillAppear(animated: Bool) { super.viewWillAppear

Adding [myUITextField becomeFirstResponder]; does not bring up keyboard

女生的网名这么多〃 提交于 2019-12-11 04:30:47
问题 I've created a screen that has a UITextField on it. When I get a EditingDidBegin event, I resignFirstResponder, Bring up a Popover with another textField in it and for that TextField call the BecomeFirstResponder on it. When it runs, I get Blinking insertion pointer and the X clear contents. Though no Keyboard. The Master UIView is set to UserInteractionEnabled:YES. target action for First UITextField, its on its own view. [textField addTarget:self action:@selector(wantsToEditValue:)

UIView disappears when keyboard pops up for UITextField

这一生的挚爱 提交于 2019-12-11 03:41:44
问题 I have an UITextField inside of a container view, when the keyboard pops up the container view disappears. In the same container view is a UICollectionView , whose custom cells each contains a UITextField and the keyboard works just fine for them. I printed out the frame of the container view in the animation function that is called by keyboardWillShow and the container view's frames are the same for both cases, so it looks like the container view just disappears (instead of "not moved" as i

How to require a minimum text length in UITextField before enabling keyboard return key

陌路散爱 提交于 2019-12-10 20:27:41
问题 In my app users register or login at a site that requires passwords at least 6 characters long. To work with that I'd like to impose that minimum in the password UITextField before the keyboard return button is enabled. Setting Auto-enable Return Key in the XIB causes the return key to be disabled until there is at least one character & (contrary to my expectations) turning that off causes the return key to be anabled even with no text. Can anyone tell me how I can keep the return key

How do I programmatically switch keyboard layouts on the iPad?

巧了我就是萌 提交于 2019-12-10 17:59:54
问题 I am having trouble finding resources on this, it may be a keyword thing. I am developing for the iPad, and I have text fields with numbers. I understand there is not a dedicated numeric keyboard, I wish to know if there is a way after the keyboard shows to programmatically switch to the numeric view. I have seen other apps do this, so I don't think it is a matter of 'if' as much as 'how'. How do I programmatically switch keyboard layouts on the iPad? 回答1: Set your text field's keyboardType

Keyboard autocorrection height (with/without the autocorrection)

断了今生、忘了曾经 提交于 2019-12-10 17:54:02
问题 I get the keyboard height like this: - (void)keyboardNotification:(NSNotification*)notification { NSDictionary* keyboardInfo = [notification userInfo]; NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameEndUserInfoKey]; CGRect keyboardFrameBeginRect = [keyboardFrameBegin CGRectValue]; } Now, I have the keyboard height. But without the autocorrection height: If the UITextAutocorrectionType is YES / NO the keyboard height stay the same. How can I get the Keyboard

Add a done button in a UINavigationbar

社会主义新天地 提交于 2019-12-10 17:33:45
问题 How does one add a done button to a UINavigationbar when the user touches a specific textfield or textview? Or would a better way be to detect when the keyboard is showing, and then display the button. I would like the done button to dismiss the keyboard like in standard Notes application. 回答1: You could try something similar to this: - (void)textFieldDidBeginEditing:(UITextField *)textField { UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem