Search code examples
pythonkivykivymd

How to use "NoTransition" in KivyMD?


This first code works as a slide transition however, I am trying to implement the "NoTransition" option but I can't find anything on google nor does the documentation shows how to code it.

def option_2(self):
    self.manager.current = "go_to_element_2_screen"
    self.manager.transition.direction = 'left'

This is what I tried but it doesn't work.

def option_2(self):
    self.manager.current = "go_to_element_2_screen"
    self.manager.transition = NoTransition

How can I implement the "NoTransition" option in kivymd?


Solution

  • As per John Anderson's advice above, my code was missing a () after NoTransition. The following works:

    def option_2(self):
        self.manager.transition = NoTransition()
        self.manager.current = "go_to_element_2_screen"