Custom keyboard for uiwebview for ipad - ios

I am working on an iPad app which works in UIWebView, and I want to use a custom keyboard that contains only numbers (0-9) like iPhone numpad for some of the input fields.
Any suggestions or code sample please.

You can make the UIWebView display the number pad keyboard by setting the attribute in the input tag.
<input type="number" />

Apple already has a numeric keyboard that you can use.
You can programmatically set it using:
input type="number"
You can also set it through the Interface Builder.

Related

Numeric Keypad and the text input is not visible in iOS screenshot

I have set the passwordTF.secureTextEntry = true and everything is working fine the UITextField is getting masked . But I see that if take a screenshot with the numeric keypad and masked input then the screenshot doesn't contains any keypad or text. Everything is blank . Is it the security feature of iOS for secureTextEntry ?
I tried to search but could not find any specific documents and I am using iOS 14.6
Sorry for being late actually I found out that it is a security feature which is in action since iOS 13 itself so if you have a keyboard which is numeric and in case you have a text field with secure text masking on then the screenshot captured will not show the keyboard or the textfield contents
Apple Discussion 1
Apple Discussion 2

Disable microphone button in UITextField keyboard

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

iOS Custom Keyboard Types

I'm worked on a custom keyboard and Apple review team rejected it because the keyboard does not support 'Numbers and Decimals' types.
So, I found that the problem is that when a text field requires those specific type of keyboard (for example to inset age, measures, or other numeric values), my keyboard 'misses to respond'.
I understood, reading from Apple documentation, that you must respond to the UIKeyboardTpye property per text object's.
I searched for specific delegate of the UIInputViewController but I wasn't able to find something close to that.
In this forum I found that one good place to examine the current keyboard type required is the textDidChange: delegate, but, it is not called.
I suppose this responder is called when your keyboard, somehow, 'declares' to iOS that it can handle Numbers or Decimal types. In fact I created a simple app with a simple UITextView that requires the Decimal keyboard type:
textView.keyboardType = UIKeyboardTypeDecimalPad;
And I put a NSLog() in the keyboard extension Input View Controller textDidChange: delegate.
As I tap on the text view my delegate is not called, instead the standard Decimal keypad is shown and in the Xcode console I see the following message:
Can't find keyplane that supports type 8 for keyboard iPhone-Portrait-DecimalPad; using 405786210_Portrait_iPhone-Simple-Pad_Default
I noticed also that this message comes when the UITextView requires the not-allowed keyboard types, i.e. the phonepad. All other keyboard types do not issue that message and the custom keyboard is shown and the textDidChange: delegate is correctly called.
The Numbers and Decimal types are surely allowed and are a MUST for the review team guys. Why the behave as a forbidden-types?
I think we need to 'declare', for example in the info.plist that our extension supports various keyboard types, but... well or more simply... I do not get the point... so... I'm asking... How can I add multiple keyboard types to my keyboard extension??
Thank you very much for help!
After the second rejection of my keyboard extension they sent me a screenshot. I noticed that they, generally, test apps on iPad. This made me think.
After some test it came out that the Numbers and Decimal types do not respond the same way on iPhone and iPad.
On iPhone a text view requiring Numbers or Decimal type keyboard always shows the iOS keypad, i.e. the custom extension is not called.
On the other side, on the iPad a text view requiring Numbers or Decimal type keyboard activates the custom extension.
Finally, after provided a standard numeric keypad (even if my keyboard uses hand-written techniquies) it was approved.

keyboard language button in UITextView

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.

How to set primefaces virtual keyboard?

Is there any option for primefaces keyboard component to accept numbers form both keyboard and mouse?
I'm using primefaces keyboard component with keypadonly option to enter numbers only.
I should be able to enter numbers either from physical keyboard or virtual keyboard.
If keypadonly is set to true, I'm not able to enter data using physical keyboard.
I don't have this problem if keypadonly only attribute is not used. Did someone experience this problem? If so please let me know how to handle it.
It seems to be intentional, if keypadonly is set to true a javascript will set the input to readonly="readonly".
You may try to use a custom layout (see http://www.primefaces.org/showcase/ui/keyboard.jsf ).
This migth work:
<p:keyboard value="#{keyboardBean.value}"
layout="custom"
layoutTemplate="123-close,456-clear,789-back,0"/>
or removing the readonly attribute with a custom javascript.

Resources