在 Cocoa 中自动调整盒子大小和定位
我正在创建一个应用程序,其中一部分如下所示:
boo http:// img188.imageshack.us/img188/7808/schermafbeelding2010021y.png
我都将它们拖到IB中的窗口中,但问题是NSImageView,操作按钮(建议,发送,戳等...),信息NSBox 和 Friends NSTabView 的高度都可以不同。它们应始终放置在彼此下方,边距为 8 像素。就像在 Facebook 上一样。我想到了一个非常修改的 NSSplitView,但也许还有更简单的方法。有人可以帮我吗?
编辑:我已将操作按钮放置在具有 NSView 类的自定义视图中。
谢谢
I'm creating an application, from which a part looks like this:
boo http://img188.imageshack.us/img188/7808/schermafbeelding2010021y.png
I all dragged them to a window in IB, but the problem is that the NSImageView, Action Buttons (Suggest, Send, Poke etc...), Information NSBox, and Friends NSTabView can all vary in height. They should always be placed below each other, with a margin of 8px. Just like on Facebook. I thought of a very modified NSSplitView, but maybe there are easier ways. Can anyone help me out?
Edit: I have placed the action buttons in a Custom View with class NSView.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须自己手动调整视图的大小。 Cocoa 不提供 Java 风格的 LayoutManager。不过,我不认为重新创建一个会太难......
You'll have to manually resize the views yourself. Cocoa does not provide Java-style LayoutManagers. However, I don't think it would be too hard to recreate one...