I use this code.
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
button.bring_to_front()
button.background_color = 'gray'
root_view.add_subview(button)
nav_view = ui.NavigationView(root_view)
nav_view.present()
When I rotate my Iphone the button is cutting.
https://pp.vk.me/c621928/v621928381/41dd5/LiEgFgmEZBo.jpg
How to fix it? Thanks..
And I have another questions. Can I run some script when user pressed the button 'back' at the navigation view? Thanks.