0

以下に示すビューをアニメーション化してリセットする方法があります。

-(void)animateToFocus:(BOOL)animate index:(NSInteger)index {
    if (animate) {
        [UIView beginAnimations:@"Scroll" context:nil];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationsEnabled:YES];
        self.view.frame = CGRectMake(0, -50*index, self.view.bounds.size.width, self.view.bounds.size.height);
        [UIView commitAnimations];

    } else {
        [UIView beginAnimations:@"Scroll" context:nil];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationsEnabled:YES];
        self.view.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
        [UIView commitAnimations];
    }

}

このメソッドで YES とタグを渡すと、アニメーションが一番上に表示され、NO を渡すとビューがリセットされます。IOS6 で完全に動作します。IOS 7 に更新すると、次のようにリセットされます。ここに画像の説明を入力

完全にアニメーション化されず、下部に黒いスペースが表示されます。これを解決するのを手伝ってもらえますか?

4

1 に答える 1

0

内部に UITableView があると思いますか?

その場合、使用する必要があるフレームをアニメーション化するべきではありません。

– scrollToRowAtIndexPath:atScrollPosition:animated:

また:

– scrollToNearestSelectedRowAtScrollPosition:animated:
于 2013-10-10T07:46:31.213 に答える