2015-05-01 31 views
0

我正在嘗試將簡單的文本字段添加到Google地圖視圖中。文本框正在顯示,但我不能寫/輸入任何內容。鍵盤也沒有出現..請幫我解決這個問題。使用iOS版Google地圖SDK的文本字段

這是我在做什麼:

//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]; 
+0

我發現了一個解決方法......但我還是謝謝你! –

+0

請發佈您爲SO社區的利益發現的解決方法。 – keithmaxx

+0

你有沒有找到任何解決方案,請將其發佈 –

回答

0

self.view.insertSubview(文本字段,aboveSubview:self.mapView)