SetScrollable does not work for NSTextFieldCell

I want every cell in the table to be scrollable from the moment it is edited. I use

        self.nsChildTextFieldObj = [[NSTextFieldCell alloc] init];
        [self.nsChildTextFieldObj setControlView:self.controlView];
        [self.nsChildTextFieldObj setBackgroundStyle:self.backgroundStyle];
        [self.nsChildTextFieldObj setScrollable:YES];
        [self.nsChildTextFieldObj setFont:[NSFont fontWithName:appDelegate.selectedFont size:appDelegate.selectedFontSize]];
        [self.nsChildTextFieldObj setEditable:NO];

but my table view cell does not scroll. Please, help!

+1
source share
1 answer

I think you can use the sizeWithFont method .

Use it every time you press a key or when pasting, and dynamically change the height of self.nsChildTextFieldObj.

0
source

Source: https://habr.com/ru/post/1747322/


All Articles