我正试图在屏幕上滑动我的UITableView动画,我在下面尝试过这个但没有成功:
-(void)slideTableViewOffScreen
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDelegate:self];
stageSelectionTable.frame = CGRectMake(stageSelectionTable.frame.origin.x - stageSelectionTable.frame.size.width, stageSelectionTable.frame.origin.y, stageSelectionTable.frame.size.height, stageSelectionTable.frame.size.width);
[UIView commitAnimations];
}
为什么它可能不起作用的任何想法,或者我需要做什么才能使这个动画工作?调用该代码时,没有任何反应。
答案 0 :(得分:0)
原来这个代码没有任何奇怪的效果:
-(void)slideTableViewOffScreen
{
CGRect newFrame = stageSelectionTable.frame;
newFrame.origin.x -= 130;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDelegate:self];
stageSelectionTable.frame = newFrame;
[UIView commitAnimations];
}