Je voudrais déplacer un ImageView autour de l'écran plusieurs fois, jusqu'à présent, j'ai trouvé deux façons. Cependant, je ne suis pas sûr de savoir lequel est le plus efficace, ou peut-être les deux sont les mêmes. S'il vous plaît, pourrais-je avoir un conseil? Merci.Quelle est la meilleure façon de déplacer un ImageView
// Create ImageView and add subview
UIImageView imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]];
imgView.frame = CGRectMake(0, 0, image_width, image_height);
[[self view] addSubview:imgView];
[imgView release];
// New Coordinates
int xNew = 100;
int yNew = 130;
// First way to move ImageView:
imgView.frame = CGRectMake(xNew, yNew, image_width, image_height);
// Second way to move ImageView:
CGPoint center;
center.x = xNew;
center.y = yNew;
imgView.center = center;