1
在一个macOS项目中,我试图获取并设置NSTableView的滚动光标位置,代码似乎工作,因为不显示错误,但光标不更新。如何保存并恢复Swift中的NSScrollView滚动位置?
var clipOrigin = tableView.enclosingScrollView?.contentView.bounds.origin // get the position
clipOrigin = CGPoint (x: 0.0, y: 3.0) // set a new position
tableView.enclosingScrollView?.contentView.scroll(to: clipOrigin!) // set the new position
我忘了什么吗?
[在插入行时保留相同的NSTableView滚动位置](http://stackoverflow.com/q/41965201/2227743) – Moritz