Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not make pinch gesture in Android #232

Closed
ber6789 opened this issue Dec 23, 2019 · 7 comments
Closed

Can not make pinch gesture in Android #232

ber6789 opened this issue Dec 23, 2019 · 7 comments

Comments

@ber6789
Copy link

ber6789 commented Dec 23, 2019

Flutter version: 1.12.13+hotfix.5
Plugin version: 2.1.0+1 ( now the latest on github)

Hi ,friend, glad to consult you again 🙂 , recently I have another problem of this plugin (only occured in Android ) , which also made me headache , here are the steps

===============================================================

  1. start a InAppWebview page and load this url ( this is baidu map)
    https://map.baidu.com/mobile/webapp/index/index/foo=bar/vt=map

  2. when loads complete , you 'll find that if you wanna pinch on the map , it won't work
    (even if I set supportZoom true ,still not work)

3. in the older version of this plugin ( previously , I choosed 1.2.1 ), it would work very fine

===============================================================

The followings are the screenshot and the option part of my codes like:

image

    ```
        initialOptions:InAppWebViewWidgetOptions(
                   
                    

                     crossPlatform: InAppWebViewOptions(
                        //debuggingEnabled: true,
                        //verticalScrollBarEnabled:false,
                        //horizontalScrollBarEnabled:false,
                        userAgent: Platform.isIOS?
                                    'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'
                                    :'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Mobile Safari/537.36',
                        transparentBackground:true,
                        preferredContentMode: InAppWebViewUserPreferredContentMode.MOBILE,
                        
                        


                    ),
                    android: AndroidInAppWebViewOptions(

                        textZoom: 100,
                        useWideViewPort: false,
                        supportZoom: true,
                        builtInZoomControls: true,
                        displayZoomControls: true,
                    ),
                    ios: IOSInAppWebViewOptions(

                        //suppressesIncrementalRendering: true
                        //enableViewportScale:true,
                    )
                 ),

So is there something to do with your updates , so that PINCH is forbidden for some reasons in Android ?

hope you can help me , best gratitude for you, and wish you a merry Christmas !😀

@leszekkrol
Copy link

We currently have the same problem as described above. We have tried in many ways and the problem persists.

@PPX47
Copy link

PPX47 commented Jan 15, 2020

It only seems to be working when you set mode to DESKTOP

@vivekkhurana
Copy link

i am also facing the same problem. Android pinch and zoom not working...
Here is the sample code

Expanded(
child: InAppWebView(
initialUrl: "https://www.flutter.dev",

                initialHeaders: {},
                initialOptions: InAppWebViewWidgetOptions(  
                  crossPlatform: InAppWebViewOptions(
                      debuggingEnabled: true,
                      disableVerticalScroll: true,
                      preferredContentMode: InAppWebViewUserPreferredContentMode.DESKTOP
                    
                  ),
                  android: AndroidInAppWebViewOptions(
                    builtInZoomControls: true,
                    //displayZoomControls: true,
                    supportZoom: true
                  )
                
                ),
                onWebViewCreated: (InAppWebViewController controller) {
                  webView = controller;
                  
                  controller.addJavaScriptHandler(handlerName: "seataddl", callback: (args){
                    print(args);
                    
                    return;
                  });
                },
                onLoadStart: (InAppWebViewController controller, String url) {
                  setState(() {
                    this.url = url;
                  });
                },
                onLoadStop: (InAppWebViewController controller, String url) async {
                  setState(() {
                    this.url = url;
                  });
                },
                onProgressChanged: (InAppWebViewController controller, int progress) {
                  setState(() {
                    this.progress = progress / 100;
                  });
                },
              ),
          ),

@vivekkhurana
Copy link

I am using master from git. Issue persists.

@AlexV525
Copy link
Contributor

有相同问题,正在研究

Facing the same issue with 3.0.0, investigating.

@pichillilorenzo
Copy link
Owner

It should be fixed from version 3.0.0+.

This was referenced Jul 6, 2020
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants