NSTextField 和 NSComboBox 在 Lion 中绘制方式不同
我有一个在 Snow Leopard 下开发的数据表单,其中有 NSTextField
框和 NSComboBox
字段,这在 Snow Leopard 下看起来很好,但现在在 Lion 中,它们'重新绘制略有不同。我还有一些带有边框按钮的 NSComboBox 字段,还有一些带有无序按钮的字段,这些字段也不匹配(尽管边框按钮 NSComboBox 看起来很接近NSTextField
,尽管它也不匹配。
我怎样才能让所有内容和谐匹配?我很乐意让 NSTextField
像组合框一样自动完成,因为我隐藏了无论如何,
无边框 NSComboBox
左,NSTextField
右(不同的上边缘):
有边框 NSComboBox 左,
NSTextField` 右(不同高度):
I've got a data form I developed under Snow Leopard, that has NSTextField
boxes alongside NSComboBox
fields, and this looked fine under Snow Leopard, but now in Lion, they're drawn slightly differently. I also have some NSComboBox
fields with a bordered button, and some with an unordered button, and these don't match, either (though the bordered button NSComboBox
looks close to the NSTextField
, though it's not a match, either.
How can I get everything to harmoniously match? I'd be happy to get an NSTextField
to autocomplete like a combo box, since I hide the button anyway.
Non-Bordered NSComboBox
left, NSTextField
right (different top edge):
Bordered NSComboBox left,
NSTextField` right (different heights):
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终用
NSTextField
控件替换了无边框组合框(我一直隐藏按钮),使用此处的方法:NSTextField 自动完成。我稍微修改了一下:
当我希望 NSComboBox 按钮可见时,我使用边框样式,它匹配得足够紧密。
I ended up replacing my non-bordered combo boxes (for which I had been hiding the buttons) with
NSTextField
controls, using the method here: NSTextField AutoCompletion.I modified it slightly:
When I want the
NSComboBox
button to be visible, I use the bordered style, which matches closely enough.