2014-10-30 4 views
0

내부에 버튼이있는 UITableViewCell의 하위 클래스가 있습니다. 단추 테두리가있는 backgroundColor이 선명합니다. 단추 중심에서부터 애니메이션을 채우고 싶습니다. 내 문제는 애니메이션이 즉시 완료된다는 것입니다. 여기에 내 코드가 있는데, 나는 이것을 두 가지 방법으로 시도했다.UITableViewCell의 애니메이션이 즉시 완료됩니다.

goingButtonBackgroundView.transform = CGAffineTransformMakeScale(0.1, 0.1); 
[UIView animateWithDuration:2. animations:^{ 
    goingButtonBackgroundView.transform = CGAffineTransformMakeScale(1.0, 1.0); 
    goingButtonBackgroundView.center = self.goingButton.center; 
}]; 

를하지만 애니메이션은 각각의 경우에 즉시 완료 :

- (void)goingButtonAnimation { 
    UIView *goingButtonBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(self.goingButton.center.x, self.goingButton.center.y, 0., 0.)]; 
    goingButtonBackgroundView.layer.cornerRadius = 2.; 
    goingButtonBackgroundView.backgroundColor = [UIColor blackColor]; 
    [self insertSubview:goingButtonBackgroundView belowSubview:self.goingButton]; 

    [UIView animateWithDuration:2. animations:^{ 
     goingButtonBackgroundView.frame = self.goingButton.frame; 
    }]; 
} 

나는 또한이 시도했습니다. goingButtonAnimation 방법은 self.goingButton

답변

1

내 문제에 도청 한 후 호출 할 goingButtonAnimation를 호출 한 후 I라는 것이 었습니다 [self.tableView reloadData]

관련 문제