iOS Google Maps textField not Responding

后端 未结 4 623
借酒劲吻你
借酒劲吻你 2020-12-10 19:53
#import \"MyLocationViewController.h\"
#import 


@interface MyLocationViewController ()

@end

@implementation MyLocationViewControll         


        
4条回答
  •  遥遥无期
    2020-12-10 20:12

    The googleMapView has a BlockingGestureRecognizer that blocks all user input. don't add the textfield to the map OR remove the blocker:

    // Remove the GMSBlockingGestureRecognizer of the GMSMapView.
    + (void)removeGMSBlockingGestureRecognizerFromMapView:(GMSMapView *)mapView
    {
        if([mapView.settings respondsToSelector:@selector(consumesGesturesInView)]) {
            mapView.settings.consumesGesturesInView = NO;
        }
        else {
            for (id gestureRecognizer in mapView.gestureRecognizers)
            {
                if (![gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]])
                {
                    [mapView removeGestureRecognizer:gestureRecognizer];
                }
            }
        }
    }
    

提交回复
热议问题