私はランダムな位置をクリックしてそれらの画像を移動するボタンで何度も何度も同じ画像を追加するアプリケーションに取り組んでいます。特定の部分に移動するuiimagegviewを束縛する方法
しかし、それらの画像を移動すると、画像はUIViewで動くように全体の視点で動くことができます。私が追加しているサブビュー(UIImageビュー)でのみ画像を移動したい。
CGPoint touchLocation = [touch locationInView:[imgPimple superview]];
私はを考える:
は、ここで何がやるべきことはあるTouchesMoved
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
UIImageView *imgPimple;// = [[UIImageView alloc]init];
imgPimple = (UIImageView*)[touch view];
CGPoint touchLocation = [touch locationInView:imgPimple superview];
if ([touch.view isKindOfClass:[UIImageView class]])
{
imgPimple.center = touchLocation;
}
}
これまでに何を試みましたか?特に何かに問題がありますか? – jtbandes