uikeyboard

Hide keyboard on touch outside of textfield

旧城冷巷雨未停 提交于 2019-12-05 03:09:20
问题 I'm trying to hide the keyboard after a touch anywhere else on the screen. The code I'm using is based on this answer here. IBOutlet UITextView *myTextView; And the method: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; if ([myTextView isFirstResponder] && [touch view] != myTextView) { [myTextView resignFirstResponder]; } [super touchesBegan:touches withEvent:event]; } What I don't understand is how I should link my

Bringing up a UIPickerview rather than keyboard input iOS

别说谁变了你拦得住时间么 提交于 2019-12-05 00:43:51
Basically I would like to have the user click in the text field and it bring up a populated pickerview rather than a keyboard. This would also need a toolbar with a done button as well Im presuming. I currently have the field set as an output and action and not much more. I also have an actionsheet in code being used for when the user submits something as well if that makes any difference to possibly using an actionsheet for this as well. I tried researching this topic but 99% of the topics were with datepickers rather than pickerviews (or very old code). Here is an image of what it looks like

Resize and move UITableViewCell smoothly without dismissing keyboard

岁酱吖の 提交于 2019-12-04 21:49:40
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 fine: [tableView setContentOffset:CGPointMake(0, myDesiredScrollOffset) animated:YES]; My problem is

how move view up when keyboard appears in iPad?

。_饼干妹妹 提交于 2019-12-04 21:28:08
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?. My suggestion is to place your objects on a UIScrollView , then when the keyboard appears, you can use scrollRectToVisible: . [scroller scrollRectToVisible:frame animated:YES]; I have wrote this code for one of my Application. It automatically detects the Position of the TextField and Scroll the baseView Accordingly. - (void)textFieldDidBeginEditing:(UITextField *)textField { [self animateTextField:textField up:YES]; } - (void

Can I create custom keyboard in iPhone?

扶醉桌前 提交于 2019-12-04 21:08:10
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 They will almost undoubtedly reject your app. The iPad Human Interface Guidelines that iPhone OS 3.2 supports keyboard customization http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadHIG/UIElements/UIElements.html#//apple_ref/doc/uid/TP40009446-CH6-SW7 来源: https:/

keyboardWillShow will only work from the second time on

时光总嘲笑我的痴心妄想 提交于 2019-12-04 15:13:19
I have a UITextView that I need to move up when the user focuses on it. In the simulator I have set up 2 keyboards (English,Greek) Within keyboardWillShow function I change the UITextView's height to be less than the existing one, as in self.page_text.frame = CGRectMake(self.page_text.frame.origin.x, self.page_text.frame.origin.y, self.page_text.frame.width, (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue().origin.y - 180) The problem is that only each first time I focus on the text view the keyboard appears but the UITextView's height does not change: After that

How to open the view with the keyboard appearing when the view is already loaded?

前提是你 提交于 2019-12-04 09:11:35
I have a requirement where I have a textfield in a view. When I want to open the view by switching the tab (TabBased Application), first time when the view is loaded the keyboard appears because i loadview method is called. But when I switch to tab2 and again switch to tab1 again, load view is not called. I want the keyboard to appear every time I open the tab1 page. Use -viewWillAppear: in your view controller to send your text field a -becomeFirstResponder message, e.g.: - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [myTextField becomeFirstResponder]; } 来源: https:

UIScrollViewKeyboardDismissModeInteractive changing tableview height with keyboard

不羁的心 提交于 2019-12-04 09:00:41
Within a UIViewController I've set self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive . This is great because the user can drag the keyboard down from the tableview. However, the tableview maintains it's current height when dragging down the keyboard. This looks odd because it leaves empty space between the keyboard and the scrollview. How can I persistently track the frame of the keyboard so I may resize the tableview as the user drags the keyboard? I've tried using UIKeyboardWillChangeFrameNotification but that seems to only get called after the user finishes

UIKeyboard Suggestions height for iOS 8 notification?

坚强是说给别人听的谎言 提交于 2019-12-04 06:40:44
I'm trying to keep a text field sitting atop the keyboard in iOS 8. But when a user swipes up or down the top of the keyboard to show or dismiss iOS 8 word suggestions, I need to a notification of the new height of the keyboard so I can move my text field up or down by that height. How can I accomplish this? Thanks! You can register for UIKeyboardDidShowNotification and then get the keyboard frame from the notification with UIKeyboardFrameEndUserInfoKey. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleKeyboardDidShowNotification:) name

How to disable a UITextField keyboard without hiding it?

时光毁灭记忆、已成空白 提交于 2019-12-04 05:27:25
问题 I have an animation, during which I want to disable the keyboard but not hide it. I even tried self.view.userInteractionEnabled = NO; , but that hides the keyboard. I guess it must call resignFirstResponder . 回答1: To disable everything, you can use [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; right before you start the animation and [[UIApplication sharedApplication] endIgnoringInteractionEvents]; after the animation finishes, e.g., in its completion block. 回答2: You can