来解决问题。
flash动画我将一个calendArviewController的视图设置为menuitem.view,当触摸menuitem的底部时。我该怎么办才能使动画变得更加平滑。
- (IBAction)respondToTapBottomView:(NSButton *)sender {
NSSize size = self.view.frame.size;
NSLog(@"%@", NSStringFromRect(self.view.window.frame));
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) {
context.duration = 0.5;
CGFloat height = 10;
if (self.bottomContentHeightConstraint.constant >= 30) {
height = 10;
} else {
height = 97;
}
CGFloat windowHeight = self.calendarView.frame.size.height + height;
self.view.animator.frame = CGRectMake(0, 0, size.width, windowHeight);
self.bottomContentHeightConstraint.animator.constant = height;
} completionHandler:^{
NSLog(@"%@", NSStringFromRect(self.view.window.frame));
}];
}
我使用这种方法,最终,我通过绘制自定义popoverView而不是使用menuitem.view。