Focused UITextField loses align and starts flickering when back to foreground - ios

I have UITextField that is a first responder, when appropriate button is pressed application goes to background and opens Phone app. When I get back to my app instead of centre vertical alignment it appears as bottom vertical alignment and it appears/disappears after every second letter is inputed. I tried several solutions, but non of them worked. If I pop the screen, and come back to it again problem is fixed, but after going to background and foreground again this bug appears again.

Related

iOS Safari header disappears when keyboard is shown

I have a website that uses the iOS safari tag „black-translucent“ and a coloured header that is „sticky“ to the top (the unsafe area), so that the time and battery (text color is white) is visible when the user scrolls.
Now when the user enters a text into a field and the keyboard shows up, the sticky header moves up and the time and battery (which are still white) are on top of my white website background and thus not visible.
How can I keep my header sticky to the top unsafe area when the keyboard is visible?
keyboard not shown
Keyboard shown
I searched stackoverflow and found out that there seems to be some buggieness around the iOS keyboard and the visible areas..
Maybe there’s a sort of hack?
Maybe scroll?
header position absolute did it for me whenever an input is in focus and reverts to sticky when input is out of focus.
With a seperate ontouchmove event listener the text field is blurred and keyboard gets hidden.
It's a bit hacky but it works especially on devices with a notch.

Strange empty grey box appears when touching View near top of my screen

A button near the top of my View is no longer clickable when I have Views with lots of padding or spacers on my page. When I reduce the padding, I am able to click the button, but only the bottom half of its image (80p tall). The top half still gives me the weird box that shows up.
It seems that the more padding / spacing I have, the further up my button goes on the screen (which is desirable), however, the button cannot be clicked above a certain y coordinate of my screen.
Has anyone seen this before? What does this empty box mean? My only guess is that its the NavigationView interfering with getting the touch, as a similar grey box occurs if I hold the back button down without releasing it.

Prevent web page from scrolling when double tap on UIWebView

I have a UIWebView which loads a very long web page. It is the size of the screen. By default, when it receives a double tap gesture at the lower middle of the view, it scrolls down, and when it receives it at the upper middle, it scrolls up.
I have a UITapGestureRecognizer for detecting double taps attached to the view of my UIViewController. When a double tap is detected, a navigation bar appears; when another one is detected, it disappears. My problem is that, most of the time, when the user double taps for showing or hiding the navigation bar, the web page is scrolled simultaneously, which is pretty annoying.
is it possible to block this behavior on the UIWebView? Or even better, is it possible to prevent double taps from reaching the UIWebView?
Thank you.

stop keyboard from shifting app up and enabling scroll in IOS 7/8

We have an app that is a fixed width and height and does not allow the user to scroll. As part of this app we have a navbar that is fixed to the screen under the status area. This all works great.
The problem is that when a keyboard is shown, it shifts our app window up to make room for the keyboard. At this point its possible to scroll our app and the titlebar which should be fixed to the top is no longer on screen.
Ideally the keyboard would still show, but our app window would resize so its not as tall, but items fixed to the top are still fixed to the top. also, you should not be able to scroll the window at this point.
So as Sani mentioned in a comment the Iconic keyboard plugin does in fact do what I'm looking for:
https://github.com/driftyco/ionic-plugins-keyboard
using:
cordova.plugins.Keyboard.disableScroll(true);
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);

Moved UINavigationBar redraws in wrong location after app becomes active from background

I have a UINavigationBar which is moved upwards (including off-screen) when the scroll view below it scrolls up. When (after pressing the Home Button) the app becomes inactive and is then resumed, the display comes back as it was beforehand, but the navigation bar is redrawn at the default position (below the status bar). When I tap the screen and scroll a minimal amount it jumps into place where it should be (usually off-screen in that case).
Is there anything short of full-blown app-restoration that can be done to rectify this?
The UINavigationBar is shifted by setting its frame. After the app becomes active, I make sure the frame is re-set to the correct size, but it still draws in the 'standard' place.
Needless to say I have already tried a multitude of approaches & forced re-draws, but to no avail. Hiding and then showing it again, calling setNeedsDisplay etc.
(This is on iOS 7)

Resources