小编Zac*_*ser的帖子

iOS Google地图textField无响应

#import "MyLocationViewController.h"
#import <GoogleMaps/GoogleMaps.h>


@interface MyLocationViewController ()

@end

@implementation MyLocationViewController {
    GMSMapView *mapView_;
    CLLocationManager *locationManager;
}

- (void)viewDidLoad
{

    [super viewDidLoad];


    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;

    [locationManager startUpdatingLocation]; 

    NSLog(@"Current identifier: %@", [[NSBundle mainBundle] bundleIdentifier]);

    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
                                                            longitude:151.20
                                                                 zoom:6];
    mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
    mapView_.myLocationEnabled = YES;

    self.view = mapView_;

    //Add text field
    UITextField *textField = [[UITextField alloc] init];
    textField.frame = CGRectMake(mapView_.bounds.size.width - 290, mapView_.bounds.size.height - 48, 180, 40);
    textField.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin …
Run Code Online (Sandbox Code Playgroud)

google-maps ios

4
推荐指数
1
解决办法
2266
查看次数

标签 统计

google-maps ×1

ios ×1