Question

I have a view-based NSTableView.

I have created a NSView to insert in this NSTableView as a row. In the xib defining the NSView, the latter has a width set to 280.

enter image description here

When I add my NSView to my NSTableView, the width of the former is changed to be equal to the width of the NSTableView.

enter image description here

Is there a nice way to prevent this behavior ? I thought of including my NSView in another one, but I feel it is a bit hacky.

If possible, I would like a solution that only involves settings of the NSTableView. This NSTableView is indeed to be populated with many differents NSViews.

Was it helpful?

Solution

As I mentioned in my comment to your previous question. You want to add your own views as subviews of NSTableCellViews. The NSTableCellView will be set to the width of the table, but your child view can be any width you like.

OTHER TIPS

this might be naive, but what happens if you uncheck Autoresizes Subviews in TableView's Attribute Inspector?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top