iOS TabBar pushed up on keyboard appearance - ios

I have an iOS8 app which has a UITabBarViewController as part of its master view. Embedded within that is a UITableViewController which has some UITextFields embedded in some of the cells.
When a text view is tapped, the keyboard automatically appears. If necessary, the 'view' is adjusted to allow the textView to remain showing so data can be entered.
The problem is that the tabBarController and associated tabs are also moved up. This is usually OK unless my phone is in landscape which leaves very little room to show the tableview and allow effective gestures (e.g. swiping the tableview up/down).
So, is there a way to get the keyboard to only push-up the tableview within the tabBarController, rather than the whole outer frame also being moved up? Picture below shows the problem. The device is in landscape

Related

How to show stickers (or other views) under UIInputAccessoryView on iOS?

I'm building a chat interface and I'm curious how apps like Telegram and iMessage achieve the following:
There's an always-on input bar that stays above the keyboard (or at the bottom of the screen if there's no keyboard). This is most likely a UIInputAccessoryView, and I've got this implemented.
There's a sticker button on the bar that, when tapped, dismisses the keyboard AND keeps the input bar in-place AND reveals another view under it that is some other view (containing stickers, etc.) The input bar basically doesn't move at all. The animation is exactly like the keyboard going away, revealing the view that appears to have always been there.
If the keyboard is hidden, tapping on the sticker button does the same as 2. What's really cool is that the sticker view is always the same height as the keyboard - and note that keyboards of different languages can be of different height (autocomplete bar), and at least in Telegram's case it can always find the right height.
Any pointer to how to achieve this is appreciated!

Input Accessory ViewController Presentation

I present a an inputAccessoryView on as part of a TableViewController, though it works smoothly most of the time, I have an issue with its presentation, as it gets presented sometimes from the right side of screen or sometimes (nicer) from bottom of the screen, any idea why and how to control that?

UIButtons initially non-functional when positioned on the right-hand side of a view

All:
I am working on an app in which I have multiple UIButtons and UITextFields on the top and right hand side of a UIView. The UIViewController is embedded in a tab bar controller, and I'm using iOS 7.
When the view first appears, the UIButtons and UITextFields on the right are unresponsive -- they are enabled (according to .isEnabled), but the buttons don't flash, and the keyboard doesn't appear when I tap on the UITextField. If I switch to another tab and then back, they work.
The controls at the top work as expected.
However, if I drag the right hand side controls more towards the center of the app, they work first time. There's like a 100 pixel "dead zone" that only goes away when I switch tabs.
Update: If I bypass the tab bar controller completely, and make the view controller associated with the above the initial view controller, then the controls work as they should.
What is going on??
Thanks,
Michael

Present UIPopoverController from a moving rect

Just got this weird problem, where I have a scroll view and buttons in the scroll view. I want to display a UIPopover from the button when touched, with UITextFields inside the UIPopover. The problem comes when the Keyboard appears. In certain cases, when the UIButton is so high in the view that the popover can only be displayed under it with the UIPopoverArrowDirectionUp, and when keyboard pops in, this popover cannot move any more up and therefore magically disappears to the top left corner (probably some Apple thing).
My solution is to check the frame of the UIPopover and to check that there is enough space for the keyboard, and if not, scroll the UIScrollView up with the buttons as well in order to be able to push the UIPopover up and so make sure that both the Keyboard and the popover fit.
So the question is: Is it possible to move the popover as the button moves?
Thanks

Toolbar hiding on rotated UISplitView DetailView

I've based my app on Apple's SplitView project type. I have a TableView as the Master, and am using different types of views as the Detail view. To select types of detail view, I'm using the fancy concept of buttons on my DetailView toolbar. When the DetailView is derived from UIViewController, everything is good. When the DetailView derives from UIViewController, but contains a UITableView then I have problems. In portrait view the toolbar is visible. In landscape mode the toolbar is hidden, even though the Tableview is moved down to allow space for it. The UIToolbar and UITableView are both defined in my NIB file which is loaded to create the detail view. Why is my toolbar invisible in landscape?
BTW, is this the best way to choose Detail view types with UISplitView? Bonus question, what if selecting a row in my DetailView tableview should bring up another View, I can't push it like I would with a NaviagtionController, so how do I go back to the detail tableview?
Thanks, Gerry
HI Gerry,
I have faced the same toolbar problem, when trying to rotate the splitView, toolbar will disappear. If you are creating the toolbar in the interface builder, try to set the toolbar properties(size), by selecting the toolbar, then --> Tools -->Size inspector, in the autosizing section, mark the left, right and upper red lines and unmark the bottom red line, then everything will works fine.
-Maria
Bonus question, I would create a UINavigationController in code, set it's rootcontroller to the DetailView tableview (self) and then push the new view on top of it.
When you react to the rotation change are you using the same view or a different one for the detail view? Seems like the new view may not contain an instance of the toolbar? Or the Tableview is covering it up because the landscape view has less vertical room than the portrait view. Are you resetting the height of the tableview to allow space for the toolbar within the 768 height when rotating to landscape?
Just a tip but whenever I run into odd things like this I remove the elements from the NIB file and create them programmatically in code and it usually solves the problem. You get a lot more control over things when you do. Overall as I've gained more experience with programming for iPhone OS I've found that I rarely put much into a NIB file any longer and do almost everything in code now.

Resources