在 Cocoa 中自动调整盒子大小和定位

发布于 2024-08-21 22:42:34 字数 451 浏览 1 评论 0原文

我正在创建一个应用程序,其中一部分如下所示:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千鲤 2024-08-28 22:42:34

您必须自己手动调整视图的大小。 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文