我正试图找到一种方法,在一个NSTextField的末尾自动向下滚动。textField是在循环中更新的,因此我想知道如何通过向下滚动显示每次输入的最后一个文本。
这是我的代码:
var tmp = consoleView.stringValue.utf16Count
if tmp >= 25000
{
consoleView.stringValue = "";
}
consoleView.stringValue = //[..longStringHere..]
consoleView.//SCROLLDOWN我在目标-c中看到了一些答案,但我从来没有在其中做过任何程序,所以我不太理解它……
谢谢
发布于 2014-08-15 22:33:52
对于滚动,我认为您更需要一个NSTextView。
textView.scrollRangeToVisible(
NSRange(location: countElements(textView.string!), length: 0))https://stackoverflow.com/questions/25335023
复制相似问题