卡布奇诺 (objective-j) / Atlas 如何从图片中提取相对和绝对定位?
我最近一直在查看 Cappuccino 和 Atlas,它们似乎将相对和绝对定位抽象为“有效”的东西。我想知道熟悉该项目的人 - 他们是如何做到这一点的?
我一直认为相对和绝对定位是一种晦涩的思考定位元素的方式,所以我对此很好奇。
我可以查看的任何帮助或资源都非常棒!
I've been checking out Cappuccino and Atlas lately, and they seem to have abstracted relative and absolute positioning away into something that just "works". I was wondering for those familiar with the project - how did they do this?
I've always thought that relative and absolute positioning is kind of an obscure way of thinking about positioning elements, so I'm really curious about this.
Any help or resources I could check out would be fantastic!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
卡布奇诺使用可可视图模型。在常规 HTML 中,重点在于文本的布局,这就是为什么您可以使用“浮动”之类的东西来将一个文本块粘贴到另一个文本块中。
在 Cappuccino 中,对象的定位和大小更像桌面。您可以将小部件放置在具有固定坐标的“视图”层次结构中,并将它们“锚定”到屏幕的一侧或多侧(或父视图)。
它就像在 Cocoa 中一样,所以只需看看它在 Interface Builder 中的描述即可:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/IB_UserGuide/Layout/Layout。 html%23//apple_ref/doc/uid/TP40005344-CH19-SW9
当然,在幕后,这一切都归结为使用 JavaScript 进行常规绝对定位来执行调整大小模型。
Cappuccino uses the Cocoa views model. In regular HTML the focus is on the layout of text, which is why you get things such as 'floats' to allow you to stick one block of text in another.
In Cappuccino, the positioning and sizing of objects is more desktop like. You position your widgets in a hierarchy of 'views' with fixed coordinates, and 'anchor' them to one or more sides of the screen (or the parent view).
It's like in Cocoa so just take a look at how it's described in the Interface Builder:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/IB_UserGuide/Layout/Layout.html%23//apple_ref/doc/uid/TP40005344-CH19-SW9
Of course, under the hood it all comes down to regular absolute positioning with JavaScript to execute the resizing model.