UITextView (다중 행용)를 화면에서 드래그 할 수있는 프로젝트가 있습니다. 지금까지 내 솔루션은 보이지 않는 UIButton의 오버레이였습니다. UIButton의 중심을 드래그했을 때 UITextView의 중심과 동일합니다.UITextView를 뷰 화면 주위로 드래그하는 방법은 무엇입니까?
그러나 UITextView를 드래그하여 바로 편집 할 수있는 앱을 보았으므로 오버레이가 아닌 것 같지만 잘 모르겠습니다.
생각하십니까? 그런데
이 코드에서 C는있는 UIButton이며, 이것은 내가 지금까지 그것을 이동 한 방법입니다
- (void) draggedOut: (UIControl *) c withEvent: (UIEvent *) ev
{
if(self.interfaceOrientation == UIInterfaceOrientationPortrait)
{
c.center = [[[ev allTouches] anyObject] locationInView:self.view];
AddedText.center = c.center;
}
else if(self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
c.center = [[[ev allTouches] anyObject] locationInView:self.view];
AddedText.center = c.center;
}
else if(self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
{
c.center = [[[ev allTouches] anyObject] locationInView:self.view];
AddedText.center = c.center;
}
else if(self.interfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
c.center = [[[ev allTouches] anyObject] locationInView:self.view];
AddedText.center = c.center;
}
}