mardi 4 août 2015

Different coordinates while resizing an imageview iOS

I'm trying to resizing an imageview using these functions:

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch* mTouch = [touches anyObject];
    if (mTouch.view == [self Logo_01]) {
        CGPoint cp = [mTouch locationInView:[self view]];
        [[mTouch view]setCenter:CGPointMake(cp.x-xd, cp.y-yd)];
        NSLog(@"questo è x");
        NSLog(@"lalal %f", cp.y);

        if (cp.y > 390) {

            [_Logo_01 setHidden:YES];
        }
        if (cp.y < 130) {
            [_Logo_01 setHidden:YES];
        }
        if (cp.x > 290) {
            [_Logo_01 setHidden:YES];
        }
        if (cp.x < 40) {
            [_Logo_01 setHidden:YES];
        }

    }

when i resize my Logo on the app the image resizes correctly but my center point is wrong

Aucun commentaire:

Enregistrer un commentaire