这是(几乎)逐字从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)