ImageViewを何回か画面の周りに移動したいのですが、これまで2通りの方法がありました。しかし、私はどちらがより効率的であるかわからない、あるいは両方が同じであるかもしれない。どうかアドバイスをいただけますか?ありがとう。どのように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;