
Screen.backgroundColor="#7ddd11"
page=new PageComponent
x: Align.center
y: Align.center
width: 300
height: 300
borderRadius: 10
scrollVertical : false
page.contentInset=
lefe:20
right:20
for i in [0..4]
layer=new Layer
parent:page.content
name:"page #{i}"
x:210*i
y:50
backgroundColor:"#fff"
borderRadius:6
opacity:0.3
page.snapToNextPage()#允许两页进行滑动
page.currentPage.opacity=1
page.onChange "currentPage",->#当前页会变成前一页
page.previousPage.animate#当前页变成前一页的动画
properties:
opacity:0.3
scale:0.1
time:0.4
page.currentPage.animate#前一页变成当前页动画
properties:
opacity:1
scale:1
time:0.4
网友评论