Reset scale/width/zoom of Safari on iPhone using JavaScript/onorientationchange

前端 未结 7 1118
臣服心动
臣服心动 2021-02-02 00:24

I am displaying different content depending on how the user is holding his/her phone using the onorientationchange call in the body tag. This works great - I hide one div while

7条回答
  •  抹茶落季
    2021-02-02 01:12

    This wont work if you are running a web-app in safari, but I think it will work if you are using a UIWebView inside your own app.

    I havent tested this, but there is an easy way to get your javascript to talk to the objective-c side of the code at which point you would have access to things like the zoom of the web view.

提交回复
热议问题