I'm trying to use the page name as a sort of dynamic label, sending information to the user in a convenient way. I can get this to work using just the custom view but it doesn't seem to work when the view is being presented via the navigation view.
Here's the code I'm testing with, any help would be appreciated:
import ui
class CustomView (ui.View):
def __init__(self):
ui.View.__init__(self, name = 'Test')
def touch_began(self, touch):
self.name = str(touch.location)
def touch_moved(self, touch):
self.name = str(touch.location)
def touch_ended(self, touch):
self.name = 'Test'
view = CustomView()
nav = ui.NavigationView(view)
view.left_button_items = [ui.ButtonItem(image = ui.Image.named('ionicons-close-24'), action = lambda sender: nav.close())]
nav.present(hide_title_bar = True)