2
UIImage를 회전하고 이동하려고합니다.UIView 회전 및 동작
im = [[UIImageView alloc ] initWithFrame:CGRectMake(160, 240, 100, 100)];
im.image = [UIImage imageNamed:@"image.png"];
[view addSubview:im];
NSTimer * timer = [NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:self selector:@selector(actionIm) userInfo:nil repeats:YES];
-(void) actionIm
{
[im setFrame:CGRectMake(im.frame.origin.x+1 , im.frame.origin.y+1 ,100, 100)];
im.transform=CGAffineTransformMakeRotation (mRotation);
mRotation+=0.1;
}
결과는 매우 이상한 행동입니다 : 다음은 내 코드입니다 난 단지 회전을 사용하는 경우 작동합니다. 내가 움직임만을 사용하면 효과가있다. 그러나 두 가지 용도 모두 이상한 결과를냅니다 (IUImage "뛰어"bizzarly).
나는 회전, 프레임, 범위, 중심에 관한 많은 것들을 빨간색으로 표시하지만 내 문제를 해결할 수있는 것은 아무것도 없다. 감사합니다.