Sharath Babu
Sharath Babu

Reputation: 71

Uiimageview not moving

I have 4 image views on a view.I want to make the 4 images movable.I used touches moved method.It seems to work for 3 of my image views .However the fourth one is not moving.The touch is detected in all cases which i have verified by NSlog.Please help.

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
    UITouch *touch = [[event allTouches] anyObject];
    CGPoint location = [touch locationInView:self.view];
    if ([touch view] == textstyleImage) {
        textstyleImage.center = location; 
        }
    else if ([touch view] == clipartImage){
        clipartImage.center = location;

    }
    else if([touch view] == customMessage){
        customMessage.center = location;
    }
    else if([touch view] == galleryImage){
        galleryImage.center = location;
    }
}

Upvotes: 0

Views: 179

Answers (1)

Dee
Dee

Reputation: 1897

Enable user interaction for that imageview like this

[fourthImageView setUserInteractionEnabled:YES];

and test it again.

Upvotes: 1

Related Questions