I have a UITextField, and the keyboard shows a mic button, which I'd like to disable. I'm especially concerned that it shouldn't show on iPhone X.
I already disabled the Emoji keyboard by setting the keyboard type to "ASCII Capable". Is there another setting to remove dictation?
We are talking about the mic symbol in lower right corner on an iPhone X.
You should not remove it since this is where users of an iPhone X are expecting it.
Also you can not remove the keyboard switcher on the left.
only if you use a custom view for the keyboard, but why?
As you can see on any other iPhone the mic key is still in the same position.
By changing type of keyboard you can discard things you don't want
textField.keyboardType = UIKeyboardTypeEmailAddress;
above one not exact solution but still that can give some idea regarding keyboard type
Hope this will help you
Related
iOS - swift 3.0 : I am developing an iOS app with English and Arabic languages. In my password text field, which is in "secure text entry" mode, when I change the text input language of the keyboard from English to Arabic, it is still showing the caps lock indicator. I am not able to figure out any solutions for this strange issue. Pls help me out. Thanks in advance.
Note: I am not able to even reproduce this often, but my client reports this bug.
I am totally clueless. Looks like iOS bug?
Okay, assuming that the Arabic keyboard basically has no shift key (and further assuming that having pressed shift before on its English counterpart doesn't actually modify the input, i.e. it's just a graphical glitch) that sounds like a bug on Apple's part.
According to this answer (which is dated, but I assume still valid) you can't really change anything about the keyboard programmatically in this sense. I.e. you can't press a button like shift in code.
If it's really just a graphical issue and you can figure out when exactly the icon should disappear, you can work around it by overlaying your own image over the button (e.g. a white square to hide it), like so. I don't know which event or delegate method would immediately happen before the image needs to be set, though, you will have to figure this out with your users.
I'd furthermore suggest filing a rdar for Apple if it's really just a graphical issue.
Finally, I came up with a solution to hide the caps lock indicator of the textfield when it is in secureTextEntry mode.
//-------To hide caps lock indicator------//
let v = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
self.passwordTextField.rightView = v
//----------------------------------------//
Basically, the caps lock indicator is presented on the right view of the UITextFiled by default, when the textfield is in secureTextEntry mode.
By assigning a view with zero dimension to the right view of the textfield , it just overrides that view with the new view(which has zero dimension) , hence the caps lock indicator never appears there after.
So, Apple has a bug right now where if you type an Emoji into a UITextField, it will shift the text down. In fact, if you type enough emojis and then backspace, it'll shift the text even further down from where it was supposed to be. I confirmed this by trying UITextFields in Twitter, Snapchat and other apps.
Here is a video of my app displaying the bug.
Use this: textField.clipsToBounds = false
It prevents the textField to move when editing. Even when you try to edit it again.
(Tested on iPhone 6, iOS 10.0)
I don't think their would be a way around this, as it just seems that the emoji is changing the margin of the text inside of the UITextField.
I'm making a custom keyboard so at first wanna make the one similar with real iOS keyboard.
On the iOS keyboard when I tap [123] button, the alphabet keys changes to number keys. THIS is what I want to do.
Is there any special ways for this?
self.textField.keyboardType = UIKeyboardType.NumberPad
Is there any way to programmatically detect installed keyboards and/or change the keyboard to a custom keyboard from within your app? As in, if I wanted to show a toolbar above the text keyboard with shortcut buttons to commonly-installed custom keyboards, could I a) detect the keyboard is installed, and b) change to a given keyboard on tap?
This assumes you want the list of keyboards setup in the Settings app under General, Keyboards.
You can determine the primary keyboard:
UITextInputMode *currentMode = [[UITextInputMode activeInputModes] firstObject];
You can determine the possible keyboards
NSArray *possibleModes = [UITextInputMode activeInputModes];
You can determine when the keyboard changes. This is done by listening for the UITextInputCurrentInputModeDidChangeNotification notification.
However, there is no API to change the keyboard.
So you can do everything you need except the most important part.
Just noticed that in UITextView keyboard comes without change language button, unlike in UITextField. Why Apple removed this button from UITextView keyboard? Is there any way to enable this button? I want people to be able to write notes on any keyboard language added in phone settings.
EDITED: Maybe it will help somebody in the future. Just noticed that I set keyboard type to UIKeyboardTypeAlphabet and this option eliminates language button. Closing this question.
P.S. I have 3 languages enabled in test iPhone.
You are completely wrong. there is no difference in UIKeyboard in iOS whatsoever. It only depends on what keyboard types you use.
UIKeyboardTypeDefault and UIKeyboardTypeEmailAddress and UIKeyboardTypeTwitter all have those.
You set it like this:
txtField.keyboardType = UIKeyboardTypeTwitter;
UIKeyboardTypeDefault is obviously the default one for any UITextView or UITextField in iOS.
For anyone have this problem even when using UIKeyboardTypeDefault on a UITextView, go into the storyboard and make sure "Secure Text Entry" is unchecked. After unchecking this, the keyboard selector will return as well as the quick type keyboard.