i am building a simple app that has several screens and i have been dealing with the android keyboard not hiding after the next screen is displayed. i have looked over the internet and have not found a solution that fixes this issue. below is a block of code that i found here. i have tried to modify it unsuccessfully. apparently i needed to import the android module for it to work but i'am not quite sure how to do it. please help if you have any idea how the hide the keyboard . Thanks
def hide_keyboard(f):
def new_function(self, *args, **kwargs):
try:
if platform == "android":
android.hide_keyboard()
self.root.from_n.focus = False
self.root.to_n.focus = False
except:
import traceback; traceback.print_exc();
f(self, *args, **kwargs)
return new_function
Looks like Window has a method for this:
from kivy.core.window import Window
Window.release_all_keyboards()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With