page.nextPage(direction, currentPage)

Get the next page. Takes two arguments: direction and the currentPage. By default, the direction is set to "right" and the currentPage will be the first page.
译:获取下一页。有两个参数:方向和currentpage。默认情况下,将第一页方向设置为“右”和currentpage。

page = new PageComponent
    width: Screen.width
    height: Screen.height

pageOne = new Layer
    width: page.width
    height: page.height
    parent: page.content
    backgroundColor: "#28affa"

pageTwo = new Layer
    width: page.width
    height: page.height
    backgroundColor: "#90D7FF"

page.addPage(pageTwo, "right")
print page.nextPage()

We can also set the currentPage to any other page. For instance, we can look which layer is at the left of the second page.

# Get the page to the left of pageTwo 
print page.nextPage("left", pageTwo)

# Returns pageOne

results matching ""

    No results matching ""