Keyboard resize event in iOS 5 (Chinese keyboard bug)? - ios

As of iOS 5, the keyboard can now be a variable height based on the input language. Specifically the Chinese language now includes an autocomplete section above the keyboard, very similar to what you see in Android. That autocomplete section increases the measured height of the keyboard.
Is there an even to which one may subscribe and/or receive notifications about when the keyboard changes dimensions as a result of the user clicking the "world" key? Note that this is different from getting the notification about the keyboard coming up (keyboardWillShow). In this case, they keyboard is already up, it's dimensions are simply changing as a result of user interaction.
Thanks!

When the input method changed, although the keyboard is already there, iOS will still send notification UIKeyboardDidShowNotification, so, register this notification, and get the location and frame change through the userInfo within notification with key UIKeyboardFrameEndUserInfoKey, then you can relayout your elements depend on the keyboard size.
more detail information, read this blog post:
(English) How to handle the keyboard frame change when input Chinese in iOS 5
(Chinese) 如何处理iOS 5中文输入法下keyboard的frame尺寸变化

Related

UIKeyboardWillHideNotification is called when keyboard is switched to emoji

I currently have the UIKeyboardWillHideNotification setup with my keyboard. When i tap the keyboard's emoji button, the notification is called, drastically messing up my UI (for i have a tool bar with a text field "attached" to it). I assume this is suppose to happen, but is there a way to detect if the keyboard is simply switching the type of keyboard? I would like that notification to be called only when the keyboard actually closes. Thank you!
duplicate question
Notice that after iOS7, Apple suggest use textInputMode.primaryLanguage, but the emoji keyboard will return nil when you access the primaryLanguage. Seem like it's a bug.

Swift: How can I change the color of keyboard background and lettering?

I am building a project for iOS8 in swift. The default and dark options for keyboard in xcode do not go with the color theme for my app design.
Is there a simple way for to change the colors in the keybaord?
The short answer is no you can't change the look and feel of the system keyboard. Even if you did many people don't even use the default keyboards.
With iOS 8 apple introduced custom keyboard extension.
A custom keyboard replaces the system keyboard for users who want
capabilities such as a novel text input method or the ability to enter
text in a language not otherwise supported in iOS. The essential
function of a custom keyboard is simple: Respond to taps, gestures, or
other input events and provide text, in the form of an unattributed
NSString object, at the text insertion point of the current text input
object.
And here's some useful tutorials about how to create custom keyboard :
http://www.appdesignvault.com/ios-8-custom-keyboard-extension/
https://www.weheartswift.com/make-custom-keyboard-ios-8-using-swift/

International keyboard crashing the app on the device

I have a problem when testing the app I wrote on the iPhone where I have set up an international keyboard.
The iPhone remembers the last input layout I used (i.e when I'm in messages and I'm using the hebrew keyboard, the next time I will use the keyboard in another app the hebrew layout will appear first) so when I'm running the app on the device and trying to input text into a textfield, the cursor appears but the keyboard doesn't, and any attempt to touch anywhere in the app causes a "Thread 1:EXC_BAD_ACCESS (code=1,address=0x14).
In addition, when the last layout I used is the english one, the app running perfectly even when I'm switching to the hebrew one.
I just noticed that it happens only with the "Name Phone Pad" keyboard, is there anyway to use this keyboard with international one?
Thanks!
My best guess is that you have a delegate that's intercepting key strokes. I reccomend you either specify the first responder per textfield and see if that works or else localize the file for english (or whatever language) only.

How to determine the dimensions of the iOS keyboard in Mobile Safari

I'm currently trying to create a suggestion UI in a web page targeted at Mobile Safari. The main components are a text box and a scrolling list that is displayed below the textbox that contains the list of suggestions.
To do this I need to 1) determine that the keyboard has shown and 2) determine the size of this in order to resize the suggestion list to fit in the available space.
I've been able to accomplish (1) by waiting for the focus event, but (2) is still problematic. I have not been able to find any way to measure the size of the keyboard as it doesn't seem to impact the window dimensions or anything else that I could think of trying to measure.
Is there anyway to programically determine the size of the iOS keyboard when it is displayed in mobile safari?
Unfortunately, there is no way to calculate the height of the keyboard. None of the window properties change when the keyboard comes up.
To determine that the keyboard is showing, you can use this solution:
iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari?
Then you'll need to add a device specific class and use media queries in your CSS along with these classes to style appropriately for device and orientation.
If someone has a better hack, I'd really love to hear about it.

Custom keyboard in iphone

Does any one know how to Create custom keyboard in iphone? Pls give me any samples for custom keyboard
Hi you need to try following link. They have explained very well and step by step that how to create Custom Keyboard. http://www.appdesignvault.com/ios-8-custom-keyboard-extension/
But while creating Custom Keyboard there are some limitations you must know:
A Custom Keyboard cannot be used to type into certain text input objects. These include the secure text input objects (any object that has its secureText property set to YES) and phone pad objects (any object that has a keyboard type trait of UIKeyboardTypePhonePad or UIKeyboardTypeNamePhonePad). When the user types in any of these text input objects, the system temporarily replaces your custom keyboard with the system keyboard, and on typing in a non-secure or non-phone pad object, your keyboard resumes.
Input dictation isn’t possible for a custom keyboard since, like all extensions in iOS 8, it has no access to the device microphone.
Selecting text is also not possible. Text selection is under the control of the app that is using the keyboard.
Closely related to the above point, editing menu options i.e. Cut, Copy, Paste are inaccessible. If an app provides an editing menu interface, the keyboard has no access to it.
App developers can reject the use of custom keyboards in their app. This can especially be done in apps that are sensitive to security such as banking apps.
You cannot display key artwork above the top edge of a custom keyboard’s primary view the same way Apple does when you tap and hold a key in the top view.
and very Important you must follow the Apple Extensions guide
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html#//apple_ref/doc/uid/TP40014214-CH16-SW1
Enjoy. Happy coding.!!!

Resources