0
在OSX上單擊菜單項目時,該項目在菜單關閉前閃爍(開 - 關 - 關)。可可:關閉菜單前的閃爍項目
我問我自己怎麼能模仿那種行爲? (我已經重新實現使用NSCollectionView,選擇&集團公司在項目,不論工作菜單)
我試過2認爲,沒有工作:
mouseOver = false;
[self drawRect:self.bounds];
mouseOver = true;
[self drawRect:self.bounds];
[[self window] performSelector:@selector(orderOut:) withObject:nil afterDelay:0.1];
和
mouseOver = false;
[self setNeedsDisplayInRect:self.bounds];
[self needsDisplay];
mouseOver = true;
[self setNeedsDisplayInRect:self.bounds];
[self needsDisplay];
[[self window] performSelector:@selector(orderOut:) withObject:nil afterDelay:0.1];