-(void)onTimer{
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(400, 100, 200, 200)];
[myLabel setBackgroundColor:[UIColor clearColor]];
myLabel.text = @"Button1 is in range";
[myLabel setTextAlignment:UITextAlignmentCenter];
[myLabel setTextColor:[UIColor whiteColor]];
NSLog(@"x=%f",Object1.center.x);
//position = CGPointMake(0,0);
//Object1.center = CGPointMake(Object1.center.x,Object1.center.y);
if((Object1.center.x >341) && (Object1.center.x < 597)){
[myLabel setHidden:NO];
}
else {
[myLabel setHidden:YES];
}
[self.view addSubview:myLabel];
}
이것은 현재 사용하고있는 코드입니다. 오브젝트가 움직일 때 x 좌표는 바뀌지 않습니다. 아무도 내가 어떻게 할 수 있는지 아니? 감사.스 와이프의 좌표를 읽는 방법
무엇을하려고합니까? 이것은 애니메이션에 관한 질문처럼 들리지만 코드에서 아무것도 움직이는 것은 없습니다. – drekka