uiview 动画
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:0.1];
if (sender.tag == 0) {
lineLabel.frame = CGRectMake(kScreenWidth / 3 * sender.tag, 40, kScreenWidth / 3, 1);
}
if (sender.tag == 1) {
lineLabel.frame = CGRectMake(kScreenWidth / 3 * sender.tag, 40, kScreenWidth / 3, 1);
}
if (sender.tag == 2) {
lineLabel.frame = CGRectMake(kScreenWidth / 3 * sender.tag, 40, kScreenWidth / 3, 1);
}
[UIView commitAnimations];
或者
[UIView animateWithDuration:0.3f animations:^{
_lineLabel.frame = CGRectMake(0, 40, kScreenWidth / 3, 1);
}];