以下に示すビューをアニメーション化してリセットする方法があります。
-(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 に更新すると、次のようにリセットされます。
完全にアニメーション化されず、下部に黒いスペースが表示されます。これを解決するのを手伝ってもらえますか?