0
누군가 다음 상황에 대한 해결책을 찾는 데 도움이된다면 고맙겠습니다.보기 프레임의 애니메이션 위치 변경이 다른보기와 겹치다
UIView의 위치를 다른 지점으로 움직이게하고 싶습니다. (이 작업을 수행 할 수 있었지만 아래 코드를 확인하십시오.) 중간에 또 다른 UIView가 있습니다. 실제로이 두 번째보기가 배치되었습니다. 보기 직후에 나는 움직이고 싶다. 기본적으로 달성하려는 것은이 두 번째 관점에서 애니메이션을 보는 것을 피하는 것입니다.
//second view placed at position x = 100, width = 20, height = 20
UIView *secondView = [[UIView alloc] initWithFrame:CGRectMake(100, 0, 20, 20)];
seconView.backgroundColor = [UIColor redColor];
[self.superview addSubview:secondView];
//from now on, this code occurs when tapping a button
//main view placed at position x = 0, width = 100, height = 20
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
view.backgroundColor = [UIColor yellowColor];
[self.superview addSubview:view];
[UIView beginAnimations:@"moveView" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:0.7f];
//main view will be moved to position x = 120, meaning that it will go through the second view.
subView.frame = CGRectOffset(view.frame, view.frame.size.width + seconView.frame.size.width, 0);
[UIView commitAnimations];
zposition, opaque, opacity, alpha 및 bringToFront 속성을 전혀 사용하지 않고 재생했습니다.