【发布时间】:2020-02-05 08:21:59
【问题描述】:
以下代码在 iOS12.2 之前一直成功运行,它在日历网格中向上滑动直到它被隐藏。
-(void) hideCalendarGrid {
[UIView animateWithDuration:10.0 delay:0 options:UIViewAnimationOptionAllowAnimatedContent animations:^{ //iwashere animation wrong iOS13. duration set to 10.0 for testing originally it was 0.2
CGRect collectionViewRect = self.collectionView.frame;
collectionViewRect.origin.y -= collectionViewRect.size.height;
self.collectionView.frame = collectionViewRect;
CGRect tableViewRect = self.tableView.frame;
tableViewRect.origin.y -= collectionViewRect.size.height;
tableViewRect.size.height += collectionViewRect.size.height;
self.tableView.frame = tableViewRect;
} completion:^(BOOL finished){
if (finished) {
// Reset frame but make it invisible
self.collectionView.hidden = YES;
self.collectionView.frame = self.collectionViewRectWhenVisible;
self.collectionViewHeightConstraint.constant = 0.0f;
self.isCalendarOn = NO;
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"isCalendarOn"];
[[NSUserDefaults standardUserDefaults] synchronize];
[self configureNavigationBar];
self.backButton.enabled = YES;
self.backButton.hidden = NO;
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"doneTutorial3.0CalendarGrid"]) {
[self showHowToHideCalendarGridTutorial];
}
}
}];
}
iOS 12.2 上的演示(按预期工作) https://youtu.be/sU5rbnujh3U
iOS 13 上的演示(不是我想要的方式) https://youtu.be/mk3AFsh5FCw
有谁知道如何在 iOS13 上让动画像 iOS12 一样工作?
【问题讨论】:
-
如果删除 UIViewAnimationOptionAllowAnimatedContent 会怎样?
-
嗨,您找到解决此问题的方法了吗? @tsuyoski
标签: ios objective-c uiviewanimation ios13