1

我有一个切换来更改字体属性。在我的 NSOutlineView 中,我调用 ReloadData 来重新渲染所有内容。但是,如何强制 NSCollectionView 重新渲染。我试过了

cvReader.NeedsLayout= true;
cvReader.Layout();

cvReader.NeedsDisplay = true;
cvReader.Display();

无济于事。非常感谢任何提示。

更新。我也试过

cvReader.NeedsDisplay = true;
cvReader.Window.ViewsNeedDisplay = true;
cvReader.Window.FlushWindowIfNeeded();

以及再次分配内容。感觉就像项目视图被缓存而不是重新生成。也许有办法清除项目视图缓存?

4

1 回答 1

4

事实证明,可以通过设置 ItemPrototype 来刷新 NSCollectionView 项目视图,例如,

ItemPrototype = new SomeViewController()

这会导致重新创建所有现有视图。

于 2014-04-08T23:51:31.377 回答