Python | Scrollview widget in kivy

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 Desktop applications.

👉🏽 Kivy Tutorial – Learn Kivy with Examples.

Scroll view:

The ScrollView widget provides a scrollable/pannable viewport that is clipped at the scrollview’s bounding box.

Scroll view accepts only one child and applies a window to it according to 2 properties:
1) scroll_x
2) scrool_y

To determine if interaction is a scrolling gesture, these properties are used:

  • scroll_distance: the minimum distance to travel, defaults to 20 pixels.
  • scroll_timeout: the maximum time period, defaults to 55 milliseconds.

To use the scrollview you must have to import it:

from kivy.uix.scrollview import ScrollView

Basic Approach:
1) import kivy
2) import kivyApp
3) import scroll view
4) import string property
5) Set minimum version(optional)
6) create the scroll view class
7) Build the .kv file within the .py file
8) Run an app

Implementation of the code:





# Program to explain how to use scroll view in kivy  
# import kivy module     
import kivy   
# base Class of your App inherits from the App class.     
# app:always refers to the instance of your application    
from import App  
# this restrict the kivy version i.e   
# below this kivy version you cannot   
# use the app or software   
# The Label widget is for rendering text
from kivy.uix.label import Label
# The ScrollView widget provides a scrollable view 
from kivy.uix.scrollview import ScrollView
# Property that represents a string value
from import StringProperty
# Static main function that starts the application loop.
from kivy.base import runTouchApp
# Builder is a global Kivy instance used in
# widgets that you can use to load other
# kv files in addition to the default ones.
from kivy.lang import Builder
# Build the .kv file
# Define the scroll view
    text: 'You are learning Kivy' * 500
        text: root.text
        font_size: 50
        text_size: self.width, None
        size_hint_y: None
        height: self.texture_size[1]
# Define scrollview class 
class ScrollableLabel(ScrollView):
    text = StringProperty('')
# run the App



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to 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.

Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.