开发者

Have an NSTableView row always stay in the same place

开发者 https://www.devze.com 2023-02-04 16:52 出处:网络
Im trying to make a trash can system in my app. I have a NSTableView and a trash can row. I want to have the row \"stick\" to the bottom of the visible table view so it can always be seen. Is it possi

Im trying to make a trash can system in my app. I have a NSTableView and a trash can row. I want to have the row "stick" to the bottom of the visible table view so it can always be seen. Is it possible to do this and if not is there a better 开发者_高级运维approach to doing this?

Thanks for any help


Sit another utterly separate UIView, on top the views that contain the table.

Simply fake it up to make it look like a row from the table.

As you say, "Thanks that sounds like it will work as long [tableview deselectRow:[tableview selectedRow] works so it appears that the fake row is really in the view." -- that is precisely what you do.


There's no supported way to do this and it might be near impossible. You might try embedding your "main" table view in a container NSView (that observes the table view's frame changes resizes / performs layout when the size changes). This view would leave room at the bottom for a single-row table view with no headers. You could feed the "main" table view all but the sticky row, and feed only the sticky row to the smaller table.

0

精彩评论

暂无评论...
验证码 换一张
取 消