how to change position of a Number Pad? - ios

By default, if you set a UITextField keyboard type to Number Pad when it is displayed, it appears on the bottom of the screen. My problem is, if the controller has a toolbar, they can not appear when the keyboard appears. I want the number pad to appear on above toolbar. Can I change the position of it?
Any ideas?
first
second

No, you're not able to change the position of the system keyboard. You can however put the toolbar on top of the keyboard. There is a property on UIKeyboard that allows this. Look at inputAccessoryView.

You should listen for the various keyboard events, such as UIKeyboardWillShowNotification and adjust the constraints/frame of your toolbar accordingly. This will allow you to place your toolbar wherever you want when the keyboard is shown and dismissed.
Reference: https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

Related

how to always show TextView text above keyboard in swift?

I have a Textview that's covered partially by the keyboard when it shows. As a result, the text which entered into the space covered by the keyboard can not be seen as it is typed.
How do I make the TextView scroll up when the entered text reached the space covered by the keyboard?
I have scroll enabled on the TextView but since all the text is visible on the screen , the vertical scroll bar is not visible. Can I have the vertical scroll bar visible at all time event when editing?
Best solution use IQKeyboardManager
library.
IQKeyboardManager works on all orientations, and with the toolbar.
There are also nice optional features allowing you to customize the
distance from the text field, add the next/previous done button as a
keyboard UIToolbar, play sounds when the user navigations through the
form and more.

iOS Partial Keyboard Display

Is it possible to display only the part of the keyboard in iOS 7? For example, I would like to display the keyboard, but I do not want the space bar visible. How would I add the keyboard to display the portion of the keyboard above the space bar?
Research has confirmed that it is not possible to adjust the frame of the keyboard.

How to fix the position of a UIPopoverController?

I have a UIPopoverController and a UITextfield embedded in it. When I tap the text field, the keyboard pops up and my popover controller shift up a bit to make space for the keyboard. But I want my popover to stay in the same position no matter if the keyboard is present. How can I do this?
The Apple popover controller adjusts itself to appear above the keyboard, and you cannot change this behavior. You only options is to either roll your own implementation or use an open-source popover implementation.

When setting UIToolBar as inputAccessoryView to UITextField hides the UIToolBar

I have tried one sample from the this link
Actually what i tried is placed an uitextfield and added that toolbar as inputaccessoryview.
When i tap on the uitexfield, it shows the uikeyboard with that toolbar added on top that is ok.
But the toolbar which was showing under the pickervieew is now get hidden after i did the above thing...
Please let me know why is that happening
If you mean your app had a toolbar at the bottom, and the picker view/keyboard/other input view appears on top of this, then this is the expected behaviour.
For example, look at mobile safari, when you enter text in a field on the page (like an SO answer, for example!), the keyboard covers the lower toolbar. Otherwise you'd hit it when typing.

uitextview keyboard appear above uitoolbar

I have a uitoolbar at bottom of my main view. I also have a uitextview at top of my view. when tapped on the textview to start editing I want the keyboard to appear from above the toolbar, not covering the tool bar. I want to know how I can do that also I don't want it to be animated.
I have one more question, when the keyboard appears is it possible to put another view in front of it?
thanks
You can't do the former. The keyboard is in a different window and so doens't interact with the views in your window. Apple doesn't provide any public access to the keyboard window.
As to the latter, putting a view in front of it, you might be able to something like that by creating another window but I've not seen anyone do it and not sure what it would do to the keyboard events, etc.

Resources