Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.
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 PageLayout class is used to create a simple multi-page layout, in a way that allows easy flipping from one page to another using border.
To use PageLayout you have to import it by the below command:
from kivy.uix.pagelayout import PageLayout
PageLayout does not currently honor the size_hint, size_hint_min, size_hint_max, or pos_hint properties.That means we can not use all these in a page layout.
1) import kivy 2) import kivyApp 3) import Pagelayout 4) import button 5) Set minimum version(optional) 6) create App class: - define build() function 7) return Layout/widget/Class(according to requirement) 8) Run an instance of the class
Implementation of the Approach:
Page 1 image
Page 2 image
Page 3 image
In PageLayout You can add some features on every page. We can add image, create canvas, add color, add multiple widgets, multiple layouts
This is how we can use the PageLayout in an efficient way. One of the best example Our gallery Contains multiple pages.
Below is the code in which i am adding the different color to every page with the help of get_color_from_hex
Implementation of the PageLayout with features
Note: More effective when works on Android, Ios, any other touch supported Laptops.
- Python | PageLayout in Kivy using .kv file
- Python| AnchorLayout in Kivy
- Python | StackLayout in Kivy
- Python | Scatter in kivy
- Python | Accordion in kivy
- Python | Bubble in kivy
- Python | Canvas in kivy
- Python | Animation in Kivy
- GridLayouts in Kivy | Python
- Python | Kivy .kv File
- Python | Tabbed panel in kivy
- Python | How to use Multiple kv files in kivy
- Python | Relative Layout in Kivy
- Python | TextInput in kivy using .kv file
- Python | Line (Canvas) in kivy
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.