0

画面からスライドする 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];
}

なぜ機能しないのか、またはこのアニメーションを機能させるために何をする必要があるのでしょうか? そのコードが呼び出されると、何も起こりません。

4

1 に答える 1

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];
}
于 2012-06-05T13:43:10.720 に答える