Kivy - Automatically Scroll Text Fields Above Mobile Keyboard | Window.softinput_mode example

Опубликовано: 11 Май 2026
на канале: Erik Sandberg
7,163
177

In just 3 lines of code, you'll never have the issue of your keyboard overlapping a text field. Works on iOS (python3 only) and Android.
👇 LINKS AND INFO! 👇

Consider donating to me if you are able to and appreciate my content: https://www.paypal.me/eriksandbergsof...



COPY/PASTE THE CODE IN YOUR main.py FILE:

from kivy.core.window import Window
Window.keyboard_anim_args = {'d': .2, 't': 'in_out_expo'}
Window.softinput_mode = "below_target"


The creators of Kivy have been developing the framework for near a decade without funding. They recently set up a fundraising campaign in an attempt to fund one (to start) core developer of the framework. If you are so inclined, join me in contributing a small donation to help fund this wonderful project. I'm sure they really appreciate the support! Use the link below to check out their donation page.
https://opencollective.com/kivy/donat...

Thanks for watching!

Erik

Follow me on Github!
https://github.com/Dirk-Sandberg

This video uses the following music:


Gymnopedie No 1 by Kevin MacLeod is licensed under a Creative Commons Attribution license (https://creativecommons.org/licenses/...)
Source: http://incompetech.com/music/royalty-...
Artist: http://incompetech.com/