gesture issue with mapview in viewpager page

后端 未结 2 1443
南旧
南旧 2020-12-08 10:53

My app\'s main interface is a viewpager where the user just slides the pages horizontally to get to the various pages. One of the pages has a google mapview (pasted below).

2条回答
  •  情话喂你
    2020-12-08 11:28

    If using Google Maps V2, use

    scrollingView.getClass().getPackage().getName().startsWith("maps.") in canScroll method:

    @Override
    protected boolean canScroll(View scrollingView, boolean checkV, int dx, int x, int y) {
        if (scrollingView.getClass().getPackage().getName().startsWith("maps.")) {
            return true;
        }
        return super.canScroll(scrollingView, checkV, dx, x, y);
    }
    

    Becase scrollingView is maps.j.b when using maps v2.

    Also in my code, these classes are used:

    import com.google.android.gms.maps.GoogleMap;
    import com.google.android.gms.maps.SupportMapFragment;
    

提交回复
热议问题