PageLayout – swiping pages

The PageLayout works in a different manner from other layouts. It is a dynamic layout, in the sense that it allows flipping through pages using its borders. The idea is that its components are stacked in front of each other, and we can just see the one that is on top.

The following example illustrates its use, taking advantage of the example from the previous section. The Python code (pagelayout.py) is presented here:

169. # File name: pagelayout.py 170. import kivy 171. 172. from kivy.app import App 173. from kivy.uix.pagelayout import PageLayout 174. 175. class MyPageLayout(PageLayout): 176. pass 177. 178. class PageLayoutApp(App): 179. def build(self): 180. return MyPageLayout() 181. 182. if __name__=="__main__": 183. ...

Get Kivy – Interactive Applications and Games in Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.