私のプロジェクトでは、ボタンを使用します。ボタンを押すと、UITextView (textWindow) がマップ ビュー (mapView) に追加されます。問題は、マップ上のユーザーの現在の場所から移動した後に UITextView を追加する場合です。次に UITextView を追加すると、マップは自動的にユーザーの位置に再センタリングされます。コードが自動的に再センタリングされないようにするためにコードに追加できるものはありますか?
私のコード...
- (IBAction)textButton:(id)sender {
UITextView *textWindow = [[UITextView alloc] initWithFrame:CGRectMake(10, 30, 300, 40)];
textWindow.returnKeyType = UIReturnKeyDone;
textWindow.delegate = self;
textWindow.textAlignment = NSTextAlignmentCenter;
[_mapView addSubview:textWindow];
[textWindow becomeFirstResponder];
NSLog(@"Text Button Pressed");
}