Skip to content

Instantly share code, notes, and snippets.

@tjferry14
Last active April 2, 2017 00:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjferry14/9ea8bfc0c8d089cdb530 to your computer and use it in GitHub Desktop.
Save tjferry14/9ea8bfc0c8d089cdb530 to your computer and use it in GitHub Desktop.
Nav view example
# no .pyui file is needed, the script sets everything up automatically
import ui
def button_tapped(sender):
v = ui.View()
v.background_color = 'green'
v.name = 'Pushed View'
sender.navigation_view.push_view(v)
root_view = ui.View()
root_view.background_color = 'white'
root_view.name = 'Root View'
button = ui.Button(title='Tap me')
button.action = button_tapped
root_view.add_subview(button)
nav_view = ui.NavigationView(root_view)
nav_view.present('sheet')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment