如何使NSTextField使用NSTextFieldCell的自定义子类? [英] How to make NSTextField use custom subclass of NSTextFieldCell?

查看:312
本文介绍了如何使NSTextField使用NSTextFieldCell的自定义子类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找使NSTextField底部对齐的解决方案,并且找到了并进行了调整满足我的需求.所以现在我有了这个自定义的NSTextFieldCell,但是如何告诉我的NSTextFields(以编程方式)使用此类?

I've been looking for a solution to make my NSTextField bottom-aligned and I've found this and adjusted it for my needs. So now I have this custom NSTextFieldCell but how do I tell my NSTextFields to use this class (programmatically)?

推荐答案

您是否尝试过NSControl类的setCell:方法?

Have you tried setCell: method of the NSControl class?

- (void)setCell:(NSCell *)aCell

这篇关于如何使NSTextField使用NSTextFieldCell的自定义子类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆