uikeyboard

UIView atop the Keyboard similar to iMessage App

為{幸葍}努か 提交于 2019-11-27 17:44:14
currently I'm attempting to basically implement and exact copy of Apples iMessage App. That means I need a UITextView that is docked at the bottom of the screen, and moves up when it becomes firstResponder. - That's pretty easy actually. There's a bazillion ways to do that and two of the most common are of course animating the view upwards or downwards if a notification was received. The other is to do it via the inputAccessoryView . Sadly some of the features the one has, the other doesn't. And they seem to be mutually exclusive. The big problem is rotation . I've digged through roughly at

dismiss keyboard with a uiTextView

半城伤御伤魂 提交于 2019-11-27 17:30:09
I am sure this is not that difficult, but I am having trouble finding info on how to dismiss a keyboard with the return/done key using a textview, not a textfield. here is what I have tried so far(which works with a textfield.) Thanks very much in advance for any help! // PostTravelQuestion.swift class PostTravelQuestion: UIViewController, UITextViewDelegate { @IBAction func closepostpage(sender: AnyObject) { dismissViewControllerAnimated(true, completion: nil) } @IBOutlet var postquestion: UITextView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading

InputAccessoryView docked at bottom

我是研究僧i 提交于 2019-11-27 17:15:02
I'm trying to achieve similar positioning behavior as the bottom text input bar in Apple's Messages app. I have tried many approaches, searched high and low and there are many similar questions but none have been satisfactory. To specify: There is a UIToolbar at the bottom of the view The toolbar is to follow the keyboard as the keyboard appears and disappears The toolbar should stay on top of the keyboard when the keyboard is visible When the keyboard is hidden, the toolbar stays ("docked") at the bottom of the view The proposed solutions: Manually animate the toolbar in response to keyboard

change the keyboard layout to emoji

两盒软妹~` 提交于 2019-11-27 14:53:24
is it possible to change the keyboard layout to emoji when a UITextField becomes the first responder ? or according to a user action like tapping a UIButton i know that i can change the keyboard layout to one of these typedef enum { UIKeyboardTypeDefault, // Default type for the current input method. UIKeyboardTypeASCIICapable, // Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active UIKeyboardTypeNumbersAndPunctuation, // Numbers and assorted punctuation. UIKeyboardTypeURL, // A type optimized for URL entry (shows . / .com prominently).

How to detect UIKeyboard “backspace” button touch on UITextField? [duplicate]

喜夏-厌秋 提交于 2019-11-27 13:59:49
This question already has an answer here: Detect backspace in empty UITextField 24 answers How can i detect backspace button pressed on UIKeyboard ? thanks EDIT : Is there any keyboard delegate that returns key pressed value? if the UITextField is empty, the shouldChangeTextInRange delegate method is not called You can subclass UITextField and override this method: -(void)deleteBackward; { [super deleteBackward]; NSLog(@"BackSpace Detected"); } since UITextField is compliant to the UITextInput protocol, this method is implemented, and you can override it to detect when backspace is pressed.

Creating a custom UIKeyBoard for iPhone

醉酒当歌 提交于 2019-11-27 12:57:48
If anyone has the app GymBuddy, then they will know what I am talking about. They seem to use the stock Number Pad keyboard but have added a "." button in the lower left as well as a bar across the top to switch to alpha characters. Does anyone know how to do this? Do I make a new view like the keyboard and pull it up and have the buttons correspond to the textField for input? I can't seem to find any information on customizing a keyboard or creating your own. Thanks Oscar Gomez I have done this. Basically you add your own button as a subview of the UIKeyboard like this: // This function is

iOS8: What's going on with moving views during keyboard transitions?

徘徊边缘 提交于 2019-11-27 12:56:52
After switching to iOS8, I'm getting weird behavior when I move views during a keyboard transition. Can anyone explain what's going on? Here's a minimal example to demonstrate the problem. I have a simple view with a UITextField and a UIButton . The function nudgeUp moves the text field and the button up by 10 points. It is triggered either by the buttonPressed callback, or the keyboardWillShow callback. When I tap the button, the code works as expected: buttonPressed calls nudgeUp and the button and text field jump up by 10 points. When I tap the text field, keyboardWillShow calls nudgeUp ,

Convert UIKeyboardFrameEndUserInfoKey to View or Window Coordinates

。_饼干妹妹 提交于 2019-11-27 12:05:30
问题 For the constant UIKeyboardFrameEndUserInfoKey , in the Apple docs it says: These coordinates do not take into account any rotation factors applied to the window’s contents as a result of interface orientation changes. Thus, you may need to convert the rectangle to window coordinates (using the convertRect:fromWindow: method) or to view coordinates (using the convertRect:fromView: method) before using it. So if I use [view1 convertRect:rect fromView:view2] What would I insert for the above

iOS 8 keyboard hides my textview

删除回忆录丶 提交于 2019-11-27 11:42:21
I have a UIViewController presented using self.accountViewController.modalPresentationStyle = UIModalPresentationFormSheet; and now in iOS 8 the last UITextView is hidden from the keyboard when it will pushed up. How to avoid It? newton_guima @Oleg's solution is good but it doesn't take into consideration keyboard changes in size while its already showing.. also, he hardcoded the animation duration and a few other parameters. See my solution below: Add an observer of UIKeyboardWillChangeFrameNotification to the viewDidLoad [[NSNotificationCenter defaultCenter] addObserver:self selector:

How to make return key on iPhone make keyboard disappear?

会有一股神秘感。 提交于 2019-11-27 10:35:19
I have two UITextFields (e.g. username and password) but I cannot get rid of the keyboard when pressing the return key on the keyboard. How can I do this? Sid First you need to conform to the UITextFieldDelegate Protocol in your View/ViewController's header file like this: @interface YourViewController : UIViewController <UITextFieldDelegate> Then in your .m file you need to implement the following UITextFieldDelegate protocol method: - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return YES; } [textField resignFirstResponder]; makes sure the