- (void)showLabelAnimation
{
[UIView beginAnimations:@"animationID" context:nil];
[UIView setAnimationDuration:1];
//original rectangle is (0,0,100,50)
//and I want to change label to (100,100,200,100)
label.bounds = CGRectMake(100, 100, 200, 100);
label.frame = CGRectMake(100, 100, 200, 100);
[UIView commitAnimations];
}
It works well, but I just wondering why I have to set both bounds and frame of label. They seem like the same thing. Can anyone explains this for me? Thanks in advance.
[Edit in Nov 3rd] Thanks for your help, but when I remove the setbounds line, it doesn t work well, the label will be large immediately but move to new position by animation. The resize animation does not show up.
这是我所想的一件实事。