you are right. I wrote a script. And it opens twice. I now implemented the AppSingleLaunch module. In Pythonista directly everything runs fine. But if i add a Homebutton the Mainview opens but if i try to switch with the navigationview to another view the script always tells that nav view and the loaded view is not defined.
Can you help me?class MyViewapp (ui.View): # Muss beim Einsatz von PYUI-Dateien in der View als custom_class angelegt werden. def __init__(self): # This will also be called without arguments when the view is loaded from a UI file. # You don't have to call super. Note that this is called *before* the attributes # defined in the UI file are set. Implement `did_load` to customize a view after # it's been fully loaded from a UI file. pass def did_load(self): # This will be called when a view has been fully loaded from a UI file. pass def will_close(self): # This will be called when a presented view is about to be dismissed. # You might want to save data here. global app app.will_close() pass def draw(self): # This will be called whenever the view's content needs to be drawn. # You can use any of the ui module's drawing functions here to render # content into the view's visible rectangle. # Do not call this method directly, instead, if you need your view # to redraw its content, call set_needs_display(). # Example: #print (v.width) pass def layout(self): # This will be called when a view is resized. You should typically set the # frames of the view's subviews here, if your layout requirements cannot # be fulfilled with the standard auto-resizing (flex) attribute. pass def touch_began(self, touch): # Called when a touch begins. pass def touch_moved(self, touch): # Called when a touch moves. pass def touch_ended(self, touch): # Called when a touch ends. pass def keyboard_frame_will_change(self, frame): # Called when the on-screen keyboard appears/disappears # Note: The frame is in screen coordinates. pass def keyboard_frame_did_change(self, frame): # Called when the on-screen keyboard appears/disappears # Note: The frame is in screen coordinates. pass def appclose(): global nav,v,app app.will_close() v.close() nav.close() #os.abort() #sys.exit(0) #os._exit(0) app = AppSingleLaunch("Demo app 2") if not app.is_active(): v = ui.load_view('mainview') # Customclass of MyViewapp v.right_button_items = [ui.ButtonItem(title="Ende", action=lambda x: appclose())] nav = ui.NavigationView(v) nav.name="nav" app.will_present(nav) nav.present(hide_title_bar=True)``` Thanks a lot. cu kami