我有一个切换来更改字体属性。在我的 NSOutlineView 中,我调用 ReloadData 来重新渲染所有内容。但是,如何强制 NSCollectionView 重新渲染。我试过了
cvReader.NeedsLayout= true;
cvReader.Layout();
cvReader.NeedsDisplay = true;
cvReader.Display();
无济于事。非常感谢任何提示。
更新。我也试过
cvReader.NeedsDisplay = true;
cvReader.Window.ViewsNeedDisplay = true;
cvReader.Window.FlushWindowIfNeeded();
以及再次分配内容。感觉就像项目视图被缓存而不是重新生成。也许有办法清除项目视图缓存?