ImageView를 여러 번 움직여서 지금까지 두 가지 방법을 찾았습니다. 그러나 어느 것이 더 효율적인지 또는 둘 다 같을 지 확신하지 못합니다. 제발, 조언 좀 할 수 있을까요? 감사.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;