-1

I'm trying to add a simple text field to the google map view. The textfield is getting displayed, but i can't write/type anything inside it. The keyboard don't show up either.. please help me fix this problem.

this is what i'm doing:

//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 | UIViewAutoresizingFlexibleTopMargin;
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.font = [UIFont systemFontOfSize:15];
textField.placeholder = @"Testing...";
textField.autocorrectionType = UITextAutocorrectionTypeNo;
textField.keyboardType = UIKeyboardTypeDefault;
textField.returnKeyType = UIReturnKeyDone;
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.delegate = self;
textField.userInteractionEnabled = YES;

[self.view addSubview: textField];
rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

self.view.insertSubview(TextField, aboveSubview: self.mapView)