我试图调用键盘在UITextField上打字。我是这样添加UITextField的:
@implementation SOViewController{
GMSMapView *mapView_;
}
- (void)viewDidLoad
{
self.view = mapView_;
UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(20, 20, 190, 200)];
[tf setText:@"test"];
[self.view addSubview:tf];}
是因为mapview的属性吗?有什么替代办法吗?
发布于 2014-05-02 09:59:18
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:locationManager.location.coordinate.latitude
longitude:locationManager.location.coordinate.longitude
zoom:16];
mapView_ = [GMSMapView mapWithFrame:CGRectMake(0, 44, self.view.bounds.size.width, self.view.bounds.size.height-44) camera:camera];
mapView_.myLocationEnabled = YES;
[self.view addSubview:mapView_];发布于 2014-11-10 04:34:02
如果需要在uitextfield中启用触摸,请添加此选项。
for (id gestureRecognizer in mapView_.gestureRecognizers)
{
NSLog(@"mapview recognizer %@",gestureRecognizer);
if (![gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]])
{
[mapView_ removeGestureRecognizer:gestureRecognizer];
}
}https://stackoverflow.com/questions/23425067
复制相似问题