Text after "
I have been shown in a new project with the same code. I have this:
# app_delegate.rb class AppDelegate & lt; PM :: delegate DEF on_load (application, option) @menu = open MenuDrawer end DEF show_menu @ menu.show: left edge end # menu_drawer.rb class MenuDrawer & LT; PM :: Menu :: drawer def setup self.center = HomeScreen.new (nav_bar: true) self.left = NavigationScreen self.to_show = [: pan_bezel,: pan_nav_bar] self.transition_animation =: swinging_door self.max_left_width = 250 self Shadow = false end end # navigation_screen.rb class navigation screen & lt; Promotion :: TableScreen def Table_data [{title: zero, cells: [{title: 'override this method, action: Swap_center_controller, argues: Homescreen}]}] end def swap_center_controller (screen_class) app_delegate.menu.center_controller = screen_class end end
My app is running but you can see a sidebar here:
I missed something?
not pan you Pejhel or nav bar you have to appear to the left controller should work (Which is hidden when you open the app for the first time) I was thinking about adding a menu button for example, so that it is a bit clearer. Here's how to work:
# home_screen.rb class homescreen & lt; PM :: screen title "home" def on_load set_nav_bar_button: rights, title: "menu", action: open_menu end DEF open_menu app_delegate.show_menu end-end # navigation_screen.rb class NavigationScreen & LT; Promotion :: TableScreen def Table_data [{title: zero, cells: [{title: 'screen' action: Swap_center_controller, argues: HomeScreen.new (nav_bar: true)}, {title: 'HelpScreen' action: Swap_center_controller, logic : HelpScreen.new (nav_bar: true)}]}] end def swap_center_controller (screen) app_delegate.menu.center_controller = screen app_delegate.menu.hide end end
your AppDelegate < / Code> and
MenuDrawer
will remain unchanged.
No comments:
Post a Comment