为什么PageComponent不尊重正确的contentInset

时间:2015-08-09 17:12:39

标签: framerjs

这是(几乎)逐字逐句地从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 ver 1.13.25(1583)

1 个答案:

答案 0 :(得分:0)

似乎是framerjs库的最新版本中的一个错误。 您可以通过将每个页面放在一个完整宽度的包装器中来覆盖错误。

点击此处查看固定示例:http://share.framerjs.com/z09x27iqjce1/

我希望它有所帮助:)