사용자에게 이미지 자르기 기능을 제공해야합니다. 뷰에 uiimageview가 표시되고 다른 뷰가 작은 상자처럼 움직이는 것으로 표시됩니다. 상자를 이동하면 좌표가 표시되고 uiimageview에서 새 이미지가 만들어집니다. 그런 식으로 자르기 이미지 기능을 제공합니다.uiscrollview에서 uiimageview와 같은 uiview의 크기를 조정할 수 있습니까?
지금까지 자르기 상자의 고정 너비 너비를 제공했지만 지금은 2 손가락 터치와 같은 기능을 제공해야합니다. 자르기 상자는 ScrollviewSuite 예제와 같이 내 손가락 위치만큼 크기가 조정됩니다. 사과. 나는 다음과 같이하고있다 :
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
NSUInteger tapCount = [touch tapCount];
UITapGestureRecognizer *twoFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTwoFingerTap:)];
[twoFingerTap setNumberOfTouchesRequired:2];
[newView addGestureRecognizer:twoFingerTap];
CGPoint touchLocation = [touch locationInView:self.view];
oldX = touchLocation.x;
oldY = touchLocation.y;
}
- (void)handleTwoFingerTap:(UIGestureRecognizer *)gestureRecognizer
{
CGRect frame = newView.frame; \\newframe is the crop box
frame.size.height += 100;
newView.frame = frame;
}
그러나 나는 단지 정적 인 방법으로 높이를 올릴 수있다. 두 손가락으로 터치하고 좌표를 가져 오려면 어떻게해야합니까? 어떤 도움을 많이 주시면 감사하겠습니다. 고맙습니다.