【问题标题】:Get the first visible Row of a NSTableView获取 NSTableView 的第一个可见行
【发布时间】:2017-02-14 11:53:15
【问题描述】:

我想获取 NSTableView 的顶部可见行(不是顶行)。 似乎没有办法解决这个问题。 这甚至可能吗?

谢谢

【问题讨论】:

  • 调用tableView.enclosingScrollView.documentVisibleRect,计算顶部并调用tableView.rowAtPoint()。表格视图可以翻转。
  • 这就像一个魅力

标签: swift xcode cocoa nstableview


【解决方案1】:

您可以这样做:

NSRect rect = [tableView visibleRect];
NSRange rows = [tableView rowsInRect:rect];
NSInteger firstVisibleRowIndex = rows.location;

【讨论】:

    猜你喜欢
    • 2013-12-19
    • 2023-04-10
    • 1970-01-01
    • 2012-03-13
    • 2014-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多