J'utilise les éléments suivants pour balancer l'image, mais il est à la mise à l'échelle de son point de haut gauche, comment puis-je faire la balance du centre
[UIView animateWithDuration:duration delay:delay options:options animations:^{ myImageView.frame = frame; myImageView.alpha = alpha; } completion:^(BOOL finished) { } ];
3 Réponses :
Ceci peut être le bloc d'animation pour l'échelle de l'image
ici, car laview U peut utiliser l'UIImageView P>
[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:GROW_ANIMATION_DURATION_SECONDS]; theView.transform = CGAffineTransformMakeScale(1.2, 1.2); [UIView commitAnimations];
Bonjour, merci d'avoir répondu mais je cherche une réponse en termes de nouvelle technique SDK 4 à l'aide de blocs d'animation.
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:(void (^)(void)) ^{ myImageView.transform=CGAffineTransformMakeScale(1.2, 1.2); } completion:^(BOOL finished){ myImageView.transform=CGAffineTransformIdentity; }]; this will work perfectly Good Luck
Ceci est toujours à l'écoute de la gauche pour moi sous iOS 7.1. Je ne peux pas comprendre ce que je fais mal. Peut-être que c'est autolayout ??
Essayez ceci:
[UIView animateWithDuration:2 animations:^{ float zoomScal = 5; //want 5x zoom CGPoint CenterPoint = CGPointMake(200, 300); // want center point to this imgArtifactImage.frame = CGRectMake(- CenterPoint.x * (zoomScal-1),- CenterPoint.y * (zoomScal-1),self.view.frame.size.width * zoomScal,self.view.frame.size.height * zoomScal); } completion:^(BOOL finished){}];
Peut-être que ces besoins]; à la fin.