'How to modify current ScreenManager to another
Good afternoon. I have a code structure with two ScreenManager: id: sm ==> besides being my root it has only two screens
LoginScreen:
name: 'screen_login'
MainScreen:
name: 'main'
When the login is performed it directs me to the main screen:
On the screen named 'main' it has:
1 - MDToolbar 1 - MDNavigationLayout and it has a ScreenManager of id: screen_manager with the following screens:
ScreenRecycleView
LoginScreen
ScreenSingUp
ScreenItem
1 - MDNavigationDrawer and it has a ContentNavigationDrawer with a creen_manager variable that inherits from the one described above.
There it is working beautifully! I call any of the screens above and everything runs.
The problem is that I have a screen called
<ScreenRecycleView>:
name: 'recycle_view'
and this one has a MyImageCard class that has a button:
MDFlatButton: text: "New Screen Here" increment_width: "164dp"
On it I click and I can't call the screen that I pointed out in the example.
on_release:
app.root.screen_manager.current = 'screen_item'
I've tried everything I know, I'm for your help.
Below is my code reduced to the max to help them help me:
I know my problem is screen manager but I can't solve it!
Solution 1:[1]
With your help I was able to discover: app.root.get_screen('main').ids.screen_manager.current = 'screen_item'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Elias Coutinho |
