I have an NSAlert and I set its accessoryView to be an NSTableView. It works good with small-medium amounts of data, but when the row count is getting large, the tableview resizes instead of getting a scrollbar. I would expect the table to only take up as much space as I give it in the Init frame.
var alert = NSAlert()
var sampleTable = NSTableView(frame: NSRect(x: 0, y:0, width: 400, height:400))
sampleTable.dataSource = self
alert.accessoryView = sampleTable
alert.beginSheetModal(...) // irrelevant code from here on
设置scrolliew.autohidesScrollers = false
和scrollView.hasHorizontalScroller = true
其中 scrollView 是 NSScrollView 实例
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.