Disable the kanji auto-complete (henkan) for Japanese keyboards in iOS? - ios

I am using a UITextField and have turned off the normal auto correction features but I need Japanese keyboards to not show the kanji auto-complete views that appear above the keyboard when typing. I am trying to quiz the user and so it is important that this feature is disabled.
Any ideas?

Probably this is a long time for the answer, however for the completion purpose, you can override shouldChangeCharactersInRange method and return NO from this method.
I had accidentally done this, and my auto-completion had stopped. Seems that my problem was a solution to someone else :)

You should be able to hide the predicted words by setting the autocorrectionType like this:
self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
This can also be done in storyboard -> UITextField --> Text Input Traits --> Correction = No

Related

Misuse of UITextField.inputView to get similar popup behavior of keyboard

I often want to put my own things in the same place the keyboard pops up, but for my own controls... such as putting a UIDatePicker there, or a custom UIPickerView, or whatever.
I came up with a clumsy way of getting this behavior by having a dummy UITextField and putting my custom view in its inputView property. Then when the user clicks on my item, I just trigger off the UITextField to display the view I've assigned to the inputView.
Then I got to wondering if there was a better less kludgey way to do this. I found this article Show UIPickerView like a keyboard, without UITextField where several people recommend the same thing I do.
My question is this. Is it common to (mis)use the UITextField in this manner?
Many times you will face a UITextfield that you would want to populate through a custom control other than the standrd keyboard. Thus the inputView method was declared and can be used.
What is recommended:
1- if the UItextfield is normal, use the keybard (don't change the input view)
2- if the value is numeric, show the numberpad in keyboard directly (textField.keyboardType = .numberPad)
3- if your textField is a date then you set the input view as a date picker.
4- sometimes you need a UITextField where you need to choose between stuff. Thus you develop your own custom UIPicker and set it as an input View.
5- If what you are tring to achieve don't fall in all the above then you can do your own inputView and assign it.
So in short don't be afraid, it is the normal thing to do!
Hope this helps!

UITextView responding unexpected to accessibility voice over

Currently I am walking through my whole iOS app to optimize it for accessibility voice over. When it comes to the UITextView, which I subclassed, voice over is not acting like I thought it would. My UITextView subclass is only changing a path's color on the superview's layer in becomeFirstResponder and resignFirstResponder. So nothing special on my UITextView subclass that could interfere with accessibility.
As long as there is no text in the UITextView it is acting as expected. Voiceover tells me that it is a text field and that I can double tap it to edit. But as soon as there is text in the UITextView, the only thing voice over tells me, is the value of the UITextView. Voice over doesn't tell me anymore that this is an editable text field.
Am I doing something wrong? Why is it acting like that?
I do appreciate any help!
If you didn't edit any accessibility hints or labels for the text field it should act accordingly. If selected it should say:
It is a text field
If you are editing it
The editing mode you are in
The value of the text field (nil if empty)
Where the cursor is
Then while you type it says the letters you are entering as you enter them. When you hit space or enter it should say the word you just typed. As long as your text field is exhibiting these behaviors you should be fine.
Tip: if you want to know how accessibility elements should act, try using a native iOS app with accessibility turned on and compare it with your app.

Change keyboard type of UITextField when go to another screen

I have UiTextField, when editing I change keyboard to emoji. then I go back and open another text view from another screen. but it shows emoji keyboard instead of default keyboard. please help me to fix this issue. thanks
I don't think you can fix it. It's up to the user to decide what keyboard they want visible and the setting applies across all apps, not just within your own app.
Please set the keyboardType for the UITextField
[textfield setKeyboardType:UIKeyboardTypeAlphabet]
You may look at the Apple's documentation to see in detail for keyboard implementation.
Set keyboard types
[textField setKeyboardType:UIKeyboardTypeEmailAddress];
These are the keyboard return types,
UIKeyboardTypeDefault,
UIKeyboardTypeASCIICapable,
UIKeyboardTypeNumbersAndPunctuation,
UIKeyboardTypeURL,
UIKeyboardTypeNumberPad,
UIKeyboardTypePhonePad,
UIKeyboardTypeNamePhonePad,
UIKeyboardTypeEmailAddress,
UIKeyboardTypeDecimalPad,
UIKeyboardTypeTwitter,
UIKeyboardTypeWebSearch
Check Apple Libaray , Input KeyBoard Types

Customize uikeyboardtype with #gmail.com and numbers

I want to create a UIKeyboard type that will look like the following.
This app is only for iPad and none of the default keyboard type seem to match.
Any suggestions for adding buttons to the keyboard type?
I may be wrong, but what that looks like is the standard keyboard with a custom toolbar on top. It was most likely done using the inputAccessoryView property for the textfield:
[textField setInputAccessoryView:inputAccView];
Here is where I took the example from.
As far as I am aware, this is not supported in a super easy way by default iOS system keyboards.
However, you can specify your own UIView as an "input accessory view" for a text field.
Specifically, look at this method in the UITextField documentation:
inputAccessoryView.
So you should just be able to create a UIView, style it to look very similar to the usual system keyboard UI, add UIButtons, and set it as the "input accessory view"
But you will have to do your own work to make the background of the accessory view and the buttons on it fit well with the system keyboard.

Can I make UITextField invisible?

I checked out iPhone: How can I make a UITextField invisible but still clickable?, but the OP has something else going on and the answers didn't seem to help me out of my fix.
I have a UITextField in which the user has to enter text. Instead of the standard UITextField graphic, I want to use a lovely graphic that's been designed for that purpose. The user would still need to be able to enter text and see the text s/he's entering, but I need the textfield to be invisible so that the graphic can show from underneath it.
How can I do this? Or is there another way to do what I'm after?
Adding my comment as an answer. You can try this,
[textField setBackgroundColor:[UIColor clearColor]];
And then set the border style as UITextBorderStyleNone.
something like:
yourTextField.borderStyle = UITextBorderStyleNone;
should do it
Another solution would be hiding the UITextView itself and just adding a transparent button that will call the keyboard to display.
Otherwise, the other answers should work.
Easiest option is to do it in interface builder. Choose the first uitext field style with no border and that's it.

Resources