uikeyboard

How to add done button on keyboard on top of keyboard in IOS?

送分小仙女□ 提交于 2019-11-28 05:21:45
I want to add the Done button on the top of keyboard on right side in iOS for a textView.Please tell me how can i do that? I want to achieve something similar to the above keyboard It can be done using storyboard: Add UITextField to UIViewController view. Add UIToolbar in the first level of UIViewController Add UIBarButtonItem into the UIToolbar. Connect UItoolbar to the code using IBOutlet. Connect UIBarButtonItem to the code using IBAction (as didClick). Make the UITextField will be delegating to UIViewController. In the didClick function end editing ( view.endEditing(true) ) In the delegate

in iOS8 using .focus() will show virtual keyboard and scroll page after touch

↘锁芯ラ 提交于 2019-11-28 04:05:17
Prior to iOS8, using the Javascript .focus() method on an input element would appear to have no effect (the virtual keyboard would not display). After the latest iOS 8 release, running the .focus() method seemed to have no effect on page load but once a user touched anywhere on the screen the virtual keyboard would instantly appear and scroll the page to the element in focus. (This is also an issue when I use the HTML attribute "autofocus") This change has caused issues with iOS8 users on my site. When a user attempts to click a button on my page the sudden scroll and keyboard appearance

dynamically change UIKeyboards return key

萝らか妹 提交于 2019-11-28 03:55:28
问题 I have two UITextfield the user enters his name into the first and email into the second. I would like to know how to change the UIKeyboards return key depending if the name text field has an entry or not. For instance if nametextfield is empty then I would like the UIkeyboard return key to be Next else if the nametextfield has an entry in it then when the user selects the email text field I would like the return key to be submit. Is this possible? if so how would I go about accomplishing it?

How can I disable/enable UISearchBar keyboard's Search button?

百般思念 提交于 2019-11-28 01:03:19
I am using UISearchBar in my code. I have imported its delegate in header file and implemented some delegate methods in implementation file also. When we tap on the UISearchBar , a keyboard will appear to enter text. The return key of the keyboard is " Search " button. It will disabled by default. When we enter a character, It will get enabled. (Am I right?) Here the problem comes.. I want to enable the UISearchBar keyboard's return key when the user types atleast two letters. Is it possible? If yes, how can we do it? Thanks You can't disable the search button. What you can do is use the

iOS: How to access the `UIKeyboard`?

别说谁变了你拦得住时间么 提交于 2019-11-27 23:10:58
I want to get a pointer reference to UIKeyboard *keyboard to the keyboard on screen so that I can add a transparent subview to it, covering it completely, to achieve the effect of disabling the UIKeyboard without hiding it . In doing this, can I assume that there's only one UIKeyboard on the screen at a time? I.e., is it a singleton? Where's the method [UIKeyboard sharedInstance] . Brownie points if you implement that method via a category. Or, even more brownie points if you convince me why it's a bad idea to assume only one keyboard and give me a better solution. Try this: // my func - (void

How to display UIView over keyboard in iOS

社会主义新天地 提交于 2019-11-27 21:35:11
I want to create a simple view over keyboard, when users tap "Attach" button in inputAccessoryView. Something like this: Is there an easy way to do it? Or i should create my custom keyboard? You can add that new subview to your application window. func attach(sender : UIButton) { // Calculate and replace the frame according to your keyboard frame var customView = UIView(frame: CGRect(x: 0, y: self.view.frame.size.height-300, width: self.view.frame.size.width, height: 300)) customView.backgroundColor = UIColor.redColor() customView.layer.zPosition = CGFloat(MAXFLOAT) var windowCount =

display soft keyboard (iPad) when is connected a bluetooth input device

旧城冷巷雨未停 提交于 2019-11-27 20:57:04
I'm really bangin' my head because I can't find the way to show the soft keyboard when there's a bluetooth input device connected to the iPad. I made some search on the web and this is the result: a question on stackoverflow with a very short answer How can I detect if an external keyboard is present on an iPad? an application developed by erica sadun for the cydia env http://www.tuaw.com/2010/06/02/hacksugar-bringing-back-the-on-screen-keyboard/ Erica said that the trick is to answer to the system that "There's no hardware keyboard attached". I tried to write a category for UIKeyboardImpl and

Leaving inputAccessoryView visible after keyboard is dismissed

自闭症网瘾萝莉.ら 提交于 2019-11-27 20:23:01
问题 What I'm trying to do is to create something similar to the "find on page" search function in Safari on iPad. I'm using a UIToolbar with some items in it and attached it to the keyboard by setting it as an inputAccessoryView on the UITextField . Works like a charm, but there is one thing I can't figure out. In Safari, when you search for something, the keyboard disappears but the tool bar remains on the bottom of the screen. Does anyone have a clue on how to accomplish this? The only solution

How to pull up a UIKeyboard without a UITextField or UITextView?

孤人 提交于 2019-11-27 20:14:54
I'm currently developing an OpenGL ES game for the iPhone and iPod touch. I was wondering how I can easily pull up the UIKeyboard? Is there an official, documented possibility to pull up a UIKeyboard without using a UITextField of UITextView? It's not "officially" possible - you can't access the UIKeyboard object at all while staying within Apple's guidelines. Creating an invisible UITextField, then calling [textField becomeFirstResponder] would do the job - you could even subclass UITextField first, then override the delegate method textField:shouldChangeCharactersInRange: to redirect the

Dismiss keyboard on IPAD

荒凉一梦 提交于 2019-11-27 18:07:27
问题 The ResignFirstResponder for an UITextField on the Iphone semms to not working for the Ipad. How can I dismiss my keyboard programmatically? Thanks, 回答1: UPDATE This answer is no longer accurate. See the correct answer. If your UITextField is in a modal page sheet view (UIModalPresentationFormSheet), then there is (currently) no way to force the device to dismiss the keyboard this devforums post from an apple engineer. 回答2: In iOS 4.3, Apple introduced the above mentioned method,