Keyboard covers the whole UIWebView - ios

I am making an iPad app and I have 3 small UIWebViews on the view. I have realized that if there is an HTML input field and I tap on it, Keyboard appears and covers one of the webviews. I can move up the web view but how can I detect which webviews' input field is tapped?

I would say use TapRecognizer active on the whole view. Using tap recognizer, find the location where it is tapped.
Now based on location I believe you can tell which webview is tapped.
Based on which webview is tapped, you can shift view upside.
Hope this will do the trick.

Related

Accessibility voiceover single swipe gestures in Swift IOS

I am working on the IOS application, related to voice over, my Question is : When accessibility voice over was enabled how can i get the swipe gestures left, right, top and down, what re the function for detecting these in swift?
First of all, you need to let VoiceOver know that about your view (or another element). So if you are in a view controller, this should work: self.view.isAccessibilityElement = true
Second, you need to let VoiceOver know that your view will handle user interactions on its own: self.view.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction. After that your view should start getting gestures notifications.
Here's another relevant answer: https://stackoverflow.com/a/20712889/2219578
It isn't possible to catch the left, right, top and bottom VoiceOver gestures : I've seen neither a protocol nor a kind of notification for this.
However, you can detect a scrolling action and be aware of the element focus provided by VoiceOver.

Adding Accessibility to piano style UI element

I'm trying to make a musical keyboard UI element accessible. Just like how GarageBand does it. In other words, at first touch user is told by VoiceOver that they are touching a musical keyboard, and from that point every tap on musical keyboard view plays notes and there’s no further VoiceOver interruptions until user touches outside of the musical keyboard frame.
I have a UICollectionView where each cell represents a musical key and when user taps on it notes are played as expected. However, I have trouble getting this to work like the GB does. For the UICollectionView object, I’ve set accessibilityLabel and have set accessibilityTraits to UIAccessibilityTraitAllowsDirectInteraction. But that doesn’t seem to work. It doesn’t play any notes when VoiceOver is on. On the first tap VoiceOver anounces whatever the accessibilityLabel is set to and then just beeps on every tap.
I have custom UIGestureRecogniser subclass that I use for the collection view cell tap detection. Do I need to do something special under these circumstances?
Any ideas? Do I need to be doing anything else?
Figured it out. Not sure what the reasoning is however.
Embeded the musical keyboard UICollectionView in another view and made that view accessible with the UIAccessibilityTraitAllowsDirectInteractiontrait. Now it works as expected.

Button Responsiveness at UIScrollView

I am dynamically creating a uiscrollview and i place some uiview's that contains some label and buttons inside to display some news. Every button inside the sub uiview calls a rest function to like, unlike or share the news. Some of the buttons opens overlay screens like comment news. I am assigning actions to buttons inside the main form that contains the uiscrollview.
When i click a button that opens an overlay screen. When i close the overlay screen and hit Like button, it does not respond to touches. After attempting one or two more times, it works.
Does anyone has any idea about this issue?
Are you using UITapGestureRecogniser for "Click action"? If yes, you propably want to set flag "cancelsTouchesInView = NO" for this recogniser.
Check to see if there is a clear view covering your button. That view will consume your tap, so the button never sees it.

Content Editable UIWebView scrolls and overlaps over the button/images of uiview in iOS

I have a view with few buttons and UIWebView which loaded content editable HTML.
In UIWebView i am inserting images/Canvas using both native and javascript functionality.
Since the WebView is editable whenever webview is clicked keyboard comes up. Now when we are inserting/editing a image/canvas keyboard should hide. So for that i am checking for tap event, getting the id of the element at that position and hiding the keyboard if that is a image/canvas using [webview endEditing:YES];.
Now the problem what i am facing is that if i add 2-3 images and then clicks on the webview, webview starts moving from its position and overlaps the button/images kept at the uiview. So the button are not visible and i am not able to perform the actions related to that.
Issue resolved. I was using some kind of animation when the keyboard was show/hidden. Once i removed that uiwebview doesn't moves.

UIWebview GestureRecognizer for showing a toolbar

I have a Webview (inside a view) and a toolbar which is hidden most of the time.
This is quite common behaviour for ipad magazines:
Tapping on the page will hide and display the toolbar, but the toolbar is hidden by default.
I am using shouldRecognizeSimultaneouslyWithGestureRecognizer
The behaviour right now does this:
- If the user taps the page (webview) it toggles the toolbar state using gesture recognizer
- if the user taps the page and there is an interactive element such as a weblink within the UIWebview, it responds to that interactive link but ALSO toggles the toolbar.
The desired behaviour is this:
- if the user taps the page on a non interactive area, it toggles the toolbar state
- if the user taps the page on an interactive area it ONLY responds to the webview interaction and does NOT toggle the toolbar.
Note there is an almost identical question here:
Gesture recognition with UIWebView
Even though it is marked as resolved if you read it through you will see the solution did not work for the poster and he is still getting a dual response when he (and I) want an either or response. I did try posting a follow up question but that was deleted probably because the moderator believed it was resolved
If the UIWebView, for whatever reason, catches the touch, you're not going to be able to get the UIGestureRecognizer callback as well. My only recomendation is to make whatever happens in the website when you tap on something execute some javascript, and then catch that Javascript. You can take this as an example.

Resources