0

这是(几乎)逐字从PageComponent示例中获取的(减去导入的 Sketch 文档),但在我的代码中,右侧contentInset完全被忽略,并且卡片在第一张卡片之后在每张卡片上奇怪地偏移。

# Set-up PageComponent
page = new PageComponent
    width: Screen.width
    height: Screen.height
    y: 0
    scrollVertical: false
    contentInset: {top: 32, left: 32, right: 32}
    backgroundColor: "pink"

# Variable that adjusts the amount of cards
amount = 4
print page.width
print screen.width
# Create and style the cards within a loop
for i in [0...amount]
    card = new Layer 
        backgroundColor: "#fff"
        borderRadius: 8
        width: page.width - 64
        height: 1040 
        x: page.width * i
        superLayer: page.content
    card.style.boxShadow = "0 1px 6px rgba(0,0,0,0.2)"

我正在使用 Framer Studio 版本 1.13.25 (1583)

4

1 回答 1

0

似乎是 framerjs 库的最新版本之一中的错误。您可以通过将每个页面放在全宽包装器中来克服该错误。

在这里查看一个固定的例子:http ://share.framerjs.com/z09x27iqjce1/ ​</p>

我希望它有帮助:)

于 2015-09-17T12:30:46.643 回答