我发生了一件奇怪的事情。我有我的视图,然后我有一个滚动视图,我用一个按钮在其中设置动画。一切正常,但原生对话框开始出现奇怪的动画?(参见 GIF 示例)当我注释掉我的代码并运行时 - 这不再发生。下面是问题代码。知道我需要更改什么以使其不影响 iOS UIAlerts 吗?任何帮助,将不胜感激!
- (IBAction)openMenu:(id)sender {
if (draw1 == 0) {
draw1 = 1;
[openMenu setTitle:@"Close" forState:UIControlStateNormal];
[UIScrollView beginAnimations:nil context:nil];
[UIScrollView setAnimationDuration:0.5];
[UIScrollView setAnimationDelay:0.0];
[UIScrollView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIButton beginAnimations:nil context:nil];
[UIButton setAnimationDuration:0.5];
[UIButton setAnimationDelay:0.0];
[UIButton setAnimationCurve:UIViewAnimationCurveEaseOut];
scrollView.frame = CGRectMake(0, 0, 768, 100);
openMenu.frame = CGRectMake(690, 195, 60, 60);
[self.view bringSubviewToFront:scrollView];
[UIScrollView commitAnimations];
} else {
draw1 = 0;
[openMenu setTitle:@"Open" forState:UIControlStateNormal];
[UIScrollView beginAnimations:nil context:nil];
[UIScrollView setAnimationDuration:0.5];
[UIScrollView setAnimationDelay:0.0];
[UIScrollView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIButton beginAnimations:nil context:nil];
[UIButton setAnimationDuration:0.5];
[UIButton setAnimationDelay:0.0];
[UIButton setAnimationCurve:UIViewAnimationCurveEaseOut];
scrollView.frame = CGRectMake(0, -100, 768, 100);
openMenu.frame = CGRectMake(690, 95, 60, 60);
[UIScrollView commitAnimations];
}
}