setScrollable not working for NSTextFieldCell

十年热恋 提交于 2019-12-31 05:05:17

问题


I want my each table cell to be scrollable since its editable.I am using

        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 is not scrolling .Please help!


回答1:


I think you can make use of sizeWithFont method.

Use it with every keypress or upon paste and change the height of self.nsChildTextFieldObj dynamically.



来源:https://stackoverflow.com/questions/5698766/setscrollable-not-working-for-nstextfieldcell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!