开发者

How do you get the default insets of NSViews and NSControls?

I'm writing some custom layout code to align some NSViews. I loop through all the views and set their frame.origin.x to the same value (left alignment), but the views don't look like they're aligned properly. I looked at left aligned views in Interface Builder, and each different class of view has a different frame.origin.x value.

For example, to left align an NSPopUpButton with an NSTextField, the frame.origin.x value of the NSPopUpButton has to be 3 pixels less than that of the NSTextField.

I found a method ibLayoutInset in Inter开发者_JAVA技巧faceBuilderKit.framework that appears to be what I want, but none of the AppKit views implement the method.

Does anyone know how to get these inset values programmatically?


Aside from measuring yourself and building your own table of offsets, you can’t. This is rather annoying, and it’s probably best to file a bug report, here: http://bugreport.apple.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜