Passing Data to a View
-
I'm displaying a view by navigating to it with a NavigationController. This view will be dynamic and will display a players stats using data retrieved from a Web API. How can I pass this data to the view?
-
@Dog2puppy, create a custom view and load the data when you initialize it:
class MyView(ui.View): def __init__(self, **kwargs): super().__init__(**kwargs) # load data from API # set up subviews based on the loaded data
If you want to set up the view and have it be responsive while you load the data, do the loading in a method decorated with
ui.in_background
.
-
This post is deleted!last edited by nazimaa