iOS Pinch In Programmatically - objective-c

I have developed an PhoneGap based app for IPhone which works very good. The app uses IPhone PhoneGap plugin called ChildBrowser. The plugin works superb but it lacked 2 features which I wanted to code myself in objective-c to fulfill my need.
There has to be some function which can execute JavaScript on WebView loaded page. I have done it and it's working.
There is a need of a function that take 2 parameters (x and y co-ordinates) and zoom in the webpage inside webview as soon as it's finished loading.
I can create te function and all JS stuff but I am not sure how to actually perform zoom-in/pinch-out programmatically. I read about ScrollView but I am not getting it how can I get it to work with WebView. Is there any property to method in WebView (I see no) which can zoom-in the webpage?

Actually, UIWebViews are zoomable by default.
You can try and check whether you have this line in your html file:
<meta name = "viewport" content = "user-scalable = no">
this will prevent zooming.
As to your first question, you can execute JS through (look here):
–stringByEvaluatingJavaScriptFromString:
and if you want to trigger some behavior when the UIWebView finished loading, then you can use the UIWebView's delegate:
– webViewDidFinishLoad:

I believe the zoom feature of the webview should be enabled or not according what you put in the viewport meta tag of the html page header.
<meta name="viewport" content="width=320, user-scalable=no">
will prevent the webview to allow zooming, you can learn more about it here

Related

iOS 14 + vuejs PWA opens camera app instead of displaying video in HTML

It works as expected on Android, but on iOS it opens camera and only after exiting the camera app it leaves the snapshot in the canvas.
How do I make iOS handle display camera feed in HTML?
I'm posting a (non-functional) fiddle, to illustrate the html and the initialization methods.
https://jsfiddle.net/nz41b2kq/
{ some code to appease the SO algorithm }
The solution was to use "playsinline" attribute in the <video> element.

Bad Smooth Scrolling on Vue JS 2 + A-Frame

I implemented an A-Frame animation inside a single section on a Vue Js 2 webapp project.
I also added a smooth scrolling component for the global app. My A-Frame block is set to "embedded" to not take the the full screen size.
On Development everything looks nice. When I go live my smooth scrolling is really bad espacially on mobile device. I looked to disable A-Frame on mobile device but no info on the doc, I tried to do it with css with media queries but still the same issue.
I don't know from where it comes and which part of code I have to fix. No error on the console.
Anyone met this kind of issue please?!
Thx
I've not run into this issue before, but you could try to place the aframe scene in a separate file, then use an iframe in your main page and see if it improves.

ios update than WebView position bug showing

some body help me~~
My Issue is this
IOS is Normal operation. but upgrade ios11 a bug broke out.
Scroll down quickly, My header menu hide, and scroll end than menu show.
My header is 'position:fixed;top:0;left:0;width:100%;height:50px;' had property.
Why does this happen?
i tried css edit and meta tag change...
Same problem.
Application develop with cordova and using uiwebview on ios.
The css fixed elements have strange comportement : Hide, hide on scroll.
Try to look at this : https://ayogo.com/blog/ios11-viewport/
If it could fix
<meta name="viewport" content="..., viewport-fit=cover">

Landscape Orientation doesn't resize my UIWebView

Here is the context of my problem :
I have a client application (ObjC)calling a player.jsp file located on the server (Java), to display it in my application in an UIWebView. The Java application is a web application which displays learning formations and i have to build an application to display these contents on an iPad.
The player in the web app uses iframes to display the content, and in my iPad application, i'm just loading this player in my UIWebView and it works, but with some sizing problems.
This player can open any type of files but I'm focusing only on HTML files.
The problem is when i switch to Landscape orientation, the content isn't resized as it should be and i can't scroll either.
When i launch the application in landscape, the size is good. Then i can switch in portrait and the resize is also done. The problem occurs only from portrait to landscape (the width is actually good but the height is too high and i can't scroll... it's not resized to the size of the launch of the app in landscape mode)
I've been searching for an answer for couple days now, been reading that adding :
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no">
into the header of my HTML files would help, but it actually doesn't. It actually even does no difference at all.
Any ideas ? Thanks
I had a similar issue, not resizing but rotation issues in general and this seemed to fix it
iOS Orientation Issues
I know its not the best help, but it didnt solve some rotatin issues aswell as resizing!

Detect when a HTML5 Video runs full screen from Objective-C

I received this request: https://github.com/Simbul/baker/issues/291
So I tried to look up if there was any event fired on Objective-C side from the UIWebView when the video began and stopped to be in full screen, in order to enable/disable again the orientation lock.
I'm aware this is possible in JavaScript:
var player = document.getElementsByTagName("video")[0];
player.addEventListener('play',videoPlayHandler,false);
player.addEventListener('pause',videoPauseHandler,false);
but I would like to avoid injecting code in the page to detect it, since Baker is a framework and we allow any content running inside it.
Thanks in advance. :)