Welcome! › Forums › Unity Plugins › In-App Web Browser › pinchAndZoom not working
Tagged: zoom pinch error bug
- This topic has 11 replies, 3 voices, and was last updated 6 years, 8 months ago by
xian9118.
-
AuthorPosts
-
June 29, 2018 at 8:07 pm #1125
elliTek
Participantif (!InAppBrowser.IsInAppBrowserOpened()) { InAppBrowser.DisplayOptions displayOptions = new InAppBrowser.DisplayOptions { browserBackgroundColor = "#00000000", hidesDefaultSpinner = true, hidesHistoryButtons = true, pinchAndZoomEnabled = true, shouldStickToLandscape = true, hidesTopBar = true }; InAppBrowser.ClearCache(); InAppBrowser.OpenURL(url, displayOptions); }
when the page opens, I cannot zoom 🙁
(Also setting the background to transparent does not work :(, I really need it to work)
-
This topic was modified 6 years, 8 months ago by
elliTek.
June 30, 2018 at 7:49 am #1127Piotr
KeymasterWhat platform is that? iOS or Android? Transparent background wont work indeed.
July 3, 2018 at 1:00 pm #1128elliTek
ParticipantI have been working on Android.
and another question, can I set the InAppBrowser to take up only a portion of the screen, not the whole thing?
July 11, 2018 at 2:28 pm #1131elliTek
ParticipantI figured out how to make the bg transparent (give it no bg color)
have you made any progress on the zoom issue?!?
July 17, 2018 at 1:51 pm #1134Piotr
KeymasterAs mentioned in docs this is iOS-only option. On Android you have to tinker with your CSS/HTML.
July 17, 2018 at 1:59 pm #1135elliTek
Participantok, guess ill try and figure that out… but your documentation does not say iOS only… you may wanna add that.
it only says “On iOS it will cause the page to fit the screen…”, never that it wont work on android…
and it only says that at the bottom after describing the default value.thanks
July 18, 2018 at 12:36 pm #1145Piotr
KeymasterOk I’ve rechecked it and it seems I was wrong.
On Android it turns on this option:
https://developer.android.com/reference/android/webkit/WebSettings.html#setBuiltInZoomControls(boolean)Sets whether the WebView should use its built-in zoom mechanisms. The built-in zoom mechanisms comprise on-screen zoom controls, which are displayed over the WebView’s content, and the use of a pinch gesture to control zooming. Whether or not these on-screen controls are displayed can be set with setDisplayZoomControls(boolean). The default is false.
The built-in mechanisms are the only currently supported zoom mechanisms, so it is recommended that this setting is always enabled.
If it does not cause any effect might it’s conneted to your website – e.g.
<meta name='viewport' />
is missing?July 18, 2018 at 1:13 pm #1148xian9118
ParticipantSo…How i use?
July 18, 2018 at 1:37 pm #1149elliTek
ParticipantI ended up using Hammer.js to add touch functionality to my site.
If you get the setBuiltInZoomControls incorporated in the InAppBrowser.DisplayOptions, that would be most helpful for future developers.July 18, 2018 at 1:47 pm #1150xian9118
ParticipantI’m going to upload general sites, not mine…
July 18, 2018 at 1:56 pm #1151Piotr
KeymasterIt’s already incorporated. If you pass
true
inpinchAndZoomEnabled
it will set this option.July 19, 2018 at 10:25 am #1152xian9118
ParticipantThank you. But it doesn’t work with smartphones.
————————————————–
options.mixedContentCompatibilityMode = true;
options.shouldUseWideViewPort = true;
options.pinchAndZoomEnabled = true;
options.setLoadWithOverviewMode = true;————————————————–
-
This topic was modified 6 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.