How to increase the row height in a NSTableView based on the text Content.Row height should be increased when there is more text and the row should shrink when the text is deleted.
I implemented the textDidChange notification in my subclass of NSTableView,but I did not find any method which will increase the row height. setRowHeight
of NSTableView will increase the height of every row in the tableview. I would like to a variable row height.Can I have any sample code or any pointers to accomplish this.
I found the following link
http://cocoadev.com/forums/discussion/1851/calculating-row-heights
But I am not able to find any example on this!. Any example on this would be a great help for me!
Tried to implement the following deleagate
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row
by calculating the string length,Now I am able to increase the row height ,but the NSTextFieldCell height is same. How can I increase the height of the textfield when the row height changes.
corbin dunn gave a solution:
-tableView:heightOfRow:
with the help of a custom NSTableCellView
object.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With