2017-03-09 4 views
0

flash animation menuitem.viewとしてCalendarViewControllerのビューを設定すると、menuitem.viewの下部をタッチすると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)); 
}]; 

}

答えて

0

は私がfinaly、私はmenuItem.viewをカスタムpopoverViewを描くのではなく使用することで問題を回避するには、この方法を使用してあきらめました。

関連する問題