2013-04-17 1 views
0

scrollview 내부에 imageview가 포함 된 이미지 맵을 만들었습니다. 특정 부분을 터치하면 내 특정 이미지 부분에 텍스트를 그려야합니다.이미지지도에 텍스트 쓰기 또는 그려주기

해당 라이브러리가 있습니까?

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    UITouch *aTouch = [touches anyObject]; 
    CGPoint point = [aTouch locationInView:self]; 
    CGFloat xPos = point.x; 
    CGFloat yPos = point.y; 
} 

를 그리고이 정보를 사용하여 매개 변수로 x와 y를 취하는 방법을합니다

답변

0

당신은 자신이 처음과 같이, 터치 지점을 받고이 작업을 수행 할 수 있습니다. 그리고 프로그래밍 방식으로 UITextField를 만듭니다.

UITextField * textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(inParameterX, inParameterY, 300, 50)]; 
textFieldRounded.textColor = [UIColor blackColor]; 
textFieldRounded.font = [UIFont systemFontOfSize:17.0]; 
textFieldRounded.backgroundColor = [UIColor clearColor]; 
textFieldRounded.autocorrectionType = UITextAutocorrectionTypeNo; 
textFieldRounded.keyboardType = UIKeyboardTypeDefault; 
textFieldRounded.returnKeyType = UIReturnKeyDone; 
textFieldRounded.clearButtonMode = UITextFieldViewModeWhileEditing; 

그리고는보기에 추가 : 텍스트 필드에 대해 수행 할 작업에 따라

[self.view addSubview:textFieldRounded]; 

대신 개체를 만들 수 있습니다. 그리고 아마 배열에 저장하십시오. 당신은 요점을 얻습니다.