positioning - Cappuccino (objective-j)/Atlas 如何从图片中提取相对和绝对定位?

标签 positioning abstraction cappuccino atlas

我最近一直在研究 Cappuccino 和 Atlas,它们似乎将相对和绝对定位抽象为“有效”的东西。我想知道熟悉该项目的人 - 他们是如何做到这一点的?

我一直认为相对和绝对定位是一种晦涩的思考定位元素的方式,所以我对此很好奇。

我可以查看的任何帮助或资源都非常棒!

最佳答案

Cappuccino 使用 Cocoa View 模型。在常规 HTML 中,重点在于文本的布局,这就是为什么您可以使用“ float ”之类的东西来将一个文本 block 粘贴到另一个文本 block 中。

在 Cappuccino 中,对象的定位和大小更像桌面。您可以将小部件放置在具有固定坐标的“ View ”层次结构中,并将它们“锚定”到屏幕的一侧或多侧(或父 View )。

这就像在 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

The springs and struts in the autosizing control define the selected view’s relationship to its parent frame. A spring causes the view to resize itself proportionally based on the width or height of its superview. A strut causes the view to maintain a fixed distance between itself and its superview along the given edge.

当然,在幕后,这一切都归结为使用 JavaScript 进行常规绝对定位来执行调整大小模型。

关于positioning - Cappuccino (objective-j)/Atlas 如何从图片中提取相对和绝对定位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3902691/

相关文章:

javascript - 禁用 JS 中的属性突变

javascript - $(document).height() 奇怪的行为

jquery - 隐藏的 div 将固定的 div 移动到窗口中间

html - CSS 正确 :5% not of parent element but % of the window's width

ruby - 是否有 SproutCore 或 Cappuccino 的现场演示/示例应用程序

cappuccino - CPOpenPanel无法在 Cappuccino 中使用

ide - 如何获得 Cappuccino 和Objective-J的代码完成?

html - 使用相对位置的底部?

c++ - 如何返回抽象类指针指向的对象?

c++ - 为什么我的类(class)被认为是抽象的?